home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1994 March / Internet Info CD-ROM (Walnut Creek) (March 1994).iso / networking / mail / elm / elm2.4.p23b < prev    next >
Encoding:
Text File  |  1993-08-22  |  96.4 KB  |  3,199 lines

  1. Subject: BETA TEST 2 of elm 2.4 Patch #23b
  2. Summary: This is an official patch for elm 2.4 system.  Please apply it.
  3. Priority: HIGH
  4.  
  5. THIS IS PART 2 OF A 4 PART PATCH
  6.  
  7. THIS PATCH IS IN BETA TEST.  IT IS SUBJECT TO CHANGE.
  8. SAVE YOUR ORIGINAL COPY OF ELM SOURCES SO YOU CAN BACK THIS OUT BEFORE 
  9. APPLYING THE OFFICIAL PATCH
  10.  
  11. Fix:    From rn, say "| patch -p -N -d DIR", where DIR is your elm source
  12.     directory.  Outside of rn, say "cd DIR; patch -p -N <thisarticle".
  13.     If you don't have the patch program, apply the following by hand,
  14.     or get patch (version 2.0, latest patchlevel).
  15.  
  16.     After patching:
  17.         Apply patches 23c, 23d next
  18.  
  19.     If patch indicates that patchlevel is the wrong version, you may need
  20.     to apply one or more previous patches, or the patch may already
  21.     have been applied.  See the patchlevel.h file to find out what has or
  22.     has not been applied.  In any event, don't continue with the patch.
  23.  
  24.     If you are missing previous patches they can be obtained from our:
  25.     archive server.
  26.  
  27.     Syd Weinstein
  28.     elm@DSI.COM
  29.  
  30.     The patches are available from the dsinc archive server
  31.     Send the following message to archive-server@DSI.COM for
  32.     a list of available patches:
  33.  
  34.     Subject: patch list
  35.     send index elm
  36.  
  37. Index: hdrs/elm.h
  38. Prereq: 5.9
  39. *** ../elm2.4/hdrs/elm.h    Sat May  8 16:03:17 1993
  40. --- hdrs/elm.h    Tue Aug 10 14:49:33 1993
  41. ***************
  42. *** 1,8 ****
  43.   
  44. ! /* $Id: elm.h,v 5.9 1993/05/08 20:03:12 syd Exp $ */
  45.   
  46.   /*******************************************************************************
  47. !  *  The Elm Mail System  -  $Revision: 5.9 $   $State: Exp $
  48.    *
  49.    *             Copyright (c) 1988-1992 USENET Community Trust
  50.    *             Copyright (c) 1986,1987 Dave Taylor
  51. --- 1,8 ----
  52.   
  53. ! /* $Id: elm.h,v 5.10 1993/08/10 18:49:32 syd Exp $ */
  54.   
  55.   /*******************************************************************************
  56. !  *  The Elm Mail System  -  $Revision: 5.10 $   $State: Exp $
  57.    *
  58.    *             Copyright (c) 1988-1992 USENET Community Trust
  59.    *             Copyright (c) 1986,1987 Dave Taylor
  60. ***************
  61. *** 14,19 ****
  62. --- 14,27 ----
  63.    *
  64.    *******************************************************************************
  65.    * $Log: elm.h,v $
  66. +  * Revision 5.10  1993/08/10  18:49:32  syd
  67. +  * When an environment variable was given as the tmpdir definition the src
  68. +  * and dest overlapped in expand_env.  This made elm produce a garbage
  69. +  * expansion because expand_env cannot cope with overlapping src and
  70. +  * dest.  I added a new variable raw_temp_dir to keep src and dest not to
  71. +  * overlap.
  72. +  * From: Jukka Ukkonen <ukkonen@csc.fi>
  73. +  *
  74.    * Revision 5.9  1993/05/08  20:03:12  syd
  75.    * add sleepmsg to list
  76.    *
  77. ***************
  78. *** 115,120 ****
  79. --- 123,129 ----
  80.   char cur_tempfolder[SLEN] = {0};/* name of temp folder open for a mailbox */
  81.   char defaultfile[SLEN] = {0};    /* name of default folder */
  82.   char temp_dir[SLEN] = {0};      /* name of temp directory */
  83. + char raw_temp_dir[SLEN] = {0};  /* unexpanded name of temp directory */
  84.   char hostname[SLEN] = {0};    /* name of machine we're on*/
  85.   char hostdomain[SLEN] = {0};    /* name of domain we're in */
  86.   char hostfullname[SLEN] = {0};    /* name of FQDN we're in */
  87.  
  88. Index: hdrs/filter.h
  89. Prereq: 5.10
  90. *** ../elm2.4/hdrs/filter.h    Sun Jun  6 14:24:47 1993
  91. --- hdrs/filter.h    Tue Aug  3 15:28:44 1993
  92. ***************
  93. *** 1,8 ****
  94.   
  95. ! /* $Id: filter.h,v 5.10 1993/06/06 17:34:40 syd Exp $ */
  96.   
  97.   /*******************************************************************************
  98. !  *  The Elm Mail System  -  $Revision: 5.10 $   $State: Exp $
  99.    *
  100.    *             Copyright (c) 1988-1992 USENET Community Trust
  101.    *             Copyright (c) 1986,1987 Dave Taylor
  102. --- 1,8 ----
  103.   
  104. ! /* $Id: filter.h,v 5.11 1993/08/03 19:28:39 syd Exp $ */
  105.   
  106.   /*******************************************************************************
  107. !  *  The Elm Mail System  -  $Revision: 5.11 $   $State: Exp $
  108.    *
  109.    *             Copyright (c) 1988-1992 USENET Community Trust
  110.    *             Copyright (c) 1986,1987 Dave Taylor
  111. ***************
  112. *** 14,19 ****
  113. --- 14,31 ----
  114.    *
  115.    *******************************************************************************
  116.    * $Log: filter.h,v $
  117. +  * Revision 5.11  1993/08/03  19:28:39  syd
  118. +  * Elm tries to replace the system toupper() and tolower() on current
  119. +  * BSD systems, which is unnecessary.  Even worse, the replacements
  120. +  * collide during linking with routines in isctype.o.  This patch adds
  121. +  * a Configure test to determine whether replacements are really needed
  122. +  * (BROKE_CTYPE definition).  The <ctype.h> header file is now included
  123. +  * globally through hdrs/defs.h and the BROKE_CTYPE patchup is handled
  124. +  * there.  Inclusion of <ctype.h> was removed from *all* the individual
  125. +  * files, and the toupper() and tolower() routines in lib/opt_utils.c
  126. +  * were dropped.
  127. +  * From: chip@chinacat.unicom.com (Chip Rosenthal)
  128. +  *
  129.    * Revision 5.10  1993/06/06  17:34:40  syd
  130.    * remove useless _vbuf definition
  131.    *
  132. ***************
  133. *** 68,77 ****
  134.   
  135.   #include "regexp.h"
  136.   
  137. - #ifdef   BSD
  138. - # undef  tolower
  139. - #endif
  140.   /** define a few handy macros for later use... **/
  141.   
  142.   #define  the_same(a,b)    (strncmp(a,b,strlen(b)) == 0)
  143. --- 80,85 ----
  144.  
  145. Index: hdrs/headers.h
  146. Prereq: 5.10
  147. *** ../elm2.4/hdrs/headers.h    Sat May  8 16:03:18 1993
  148. --- hdrs/headers.h    Tue Aug 10 16:49:55 1993
  149. ***************
  150. *** 1,8 ****
  151.   
  152. ! /* $Id: headers.h,v 5.10 1993/05/08 20:03:12 syd Exp $ */
  153.   
  154.   /*******************************************************************************
  155. !  *  The Elm Mail System  -  $Revision: 5.10 $   $State: Exp $
  156.    *
  157.    *             Copyright (c) 1988-1992 USENET Community Trust
  158.    *             Copyright (c) 1986,1987 Dave Taylor
  159. --- 1,8 ----
  160.   
  161. ! /* $Id: headers.h,v 5.11 1993/08/10 20:49:40 syd Exp $ */
  162.   
  163.   /*******************************************************************************
  164. !  *  The Elm Mail System  -  $Revision: 5.11 $   $State: Exp $
  165.    *
  166.    *             Copyright (c) 1988-1992 USENET Community Trust
  167.    *             Copyright (c) 1986,1987 Dave Taylor
  168. ***************
  169. *** 14,19 ****
  170. --- 14,22 ----
  171.    *
  172.    *******************************************************************************
  173.    * $Log: headers.h,v $
  174. +  * Revision 5.11  1993/08/10  20:49:40  syd
  175. +  * Add raw_temp_dir
  176. +  *
  177.    * Revision 5.10  1993/05/08  20:03:12  syd
  178.    * add sleepmsg to list
  179.    *
  180. ***************
  181. *** 115,120 ****
  182. --- 118,124 ----
  183.   extern char cur_tempfolder[SLEN]; /* name of temp folder open for a mailbox */
  184.   extern char defaultfile[SLEN];    /* name of default folder */
  185.   extern char temp_dir[SLEN];     /* name of temp directory */
  186. + extern char raw_temp_dir[SLEN]; /* unexpanded name of temp directory */
  187.   extern char hostname[SLEN];    /* name of machine we're on*/
  188.   extern char hostdomain[SLEN];    /* name of domain we're in */
  189.   extern char hostfullname[SLEN]; /* name of FQDN we're in */
  190.  
  191. Index: hdrs/mcprt.h
  192. *** ../elm2.4/hdrs/mcprt.h    Sat Oct  3 18:35:08 1992
  193. --- hdrs/mcprt.h    Sun Aug 22 22:46:28 1993
  194. ***************
  195. *** 48,56 ****
  196. --- 48,62 ----
  197.   #include <stdio.h>
  198.   
  199.   #ifdef USENLS
  200. + #  ifdef I_STDARG
  201. + extern int         MCprintf(char *fmt, ...);
  202. + extern int         MCfprintf(FILE *fptr, char *fmt, ...);
  203. + extern int         MCsprintf(char *cptr, char *fmt, ...);
  204. + #  else
  205.   extern int         MCprintf();
  206.   extern int         MCfprintf();
  207.   extern int         MCsprintf();
  208. + #  endif
  209.   #endif
  210.   
  211.   #endif
  212.  
  213. Index: hdrs/mcprtlib.h
  214. *** ../elm2.4/hdrs/mcprtlib.h    Sat Oct  3 18:35:09 1992
  215. --- hdrs/mcprtlib.h    Sun Aug 22 22:48:18 1993
  216. ***************
  217. *** 41,47 ****
  218.   03/20/91   2 schulert    Ultrix cc has trouble with void*, so change them to int*
  219.   01/18/91   3 hamilton    #if not rescanned
  220.   01/12/91   1 schulert    conditionally use prototypes
  221. !             rework to use either varargs or stdargs
  222.   11/03/90   2 hamilton    Alphalpha->Alfalfa & OmegaMail->Poste
  223.   08/10/90   1 nazgul    Initial version
  224.   */
  225. --- 41,47 ----
  226.   03/20/91   2 schulert    Ultrix cc has trouble with void*, so change them to int*
  227.   01/18/91   3 hamilton    #if not rescanned
  228.   01/12/91   1 schulert    conditionally use prototypes
  229. !             rework to use either varargs or stdarg
  230.   11/03/90   2 hamilton    Alphalpha->Alfalfa & OmegaMail->Poste
  231.   08/10/90   1 nazgul    Initial version
  232.   */
  233. ***************
  234. *** 49,56 ****
  235. --- 49,61 ----
  236.   /* taken from Xm/lib/VaSimple.h
  237.      currently no one defines MISSING_STDARG_H */
  238.    
  239. + #ifdef    I_STDARG
  240. + # include <stdarg.h>
  241. + # define Va_start(a,b) va_start(a,b)
  242. + #else
  243.   # include <varargs.h>
  244.   # define Va_start(a,b) va_start(a)
  245. + #endif
  246.   
  247.   #define MCFree        0x0010            /* Reminder to MCPrintFree */
  248.   #define MCCatalog    0x0100            /* Probably came from catalog */
  249.  
  250. Index: hdrs/ndbz.h
  251. Prereq: 5.2
  252. *** ../elm2.4/hdrs/ndbz.h    Sat Oct 10 21:47:09 1992
  253. --- hdrs/ndbz.h    Mon Jul 19 22:59:54 1993
  254. ***************
  255. *** 1,8 ****
  256.   
  257. ! /* $Id: ndbz.h,v 5.2 1992/10/11 01:46:35 syd Exp $ */
  258.   
  259.   /*******************************************************************************
  260. !  *  The Elm Mail System  -  $Revision: 5.2 $   $State: Exp $
  261.    *
  262.    *             Copyright (c) 1988-1992 USENET Community Trust
  263.    *             Copyright (c) 1986,1987 Dave Taylor
  264. --- 1,8 ----
  265.   
  266. ! /* $Id: ndbz.h,v 5.3 1993/07/20 02:59:53 syd Exp $ */
  267.   
  268.   /*******************************************************************************
  269. !  *  The Elm Mail System  -  $Revision: 5.3 $   $State: Exp $
  270.    *
  271.    *             Copyright (c) 1988-1992 USENET Community Trust
  272.    *             Copyright (c) 1986,1987 Dave Taylor
  273. ***************
  274. *** 14,19 ****
  275. --- 14,23 ----
  276.    *
  277.    *******************************************************************************
  278.    * $Log: ndbz.h,v $
  279. +  * Revision 5.3  1993/07/20  02:59:53  syd
  280. +  * Support aliases both on 64 bit and 32 bit machines at the same time.
  281. +  * From: Dan Mosedale <mosedale@genome.stanford.edu>
  282. +  *
  283.    * Revision 5.2  1992/10/11  01:46:35  syd
  284.    * change dbm name to dbz to avoid conflicts with partial call
  285.    * ins from shared librarys, and from mixing code with yp code.
  286. ***************
  287. *** 57,63 ****
  288.    * to have a distinctive name for it.  Beware, this is just for readability,
  289.    * don't try to change this.
  290.    */
  291. ! #define    of_t    long
  292.   #define    SOF    (sizeof(of_t))
  293.   
  294.   /*
  295. --- 61,73 ----
  296.    * to have a distinctive name for it.  Beware, this is just for readability,
  297.    * don't try to change this.
  298.    */
  299. ! /*
  300. !  * Big kludge: this is set up as 32-bit rather than a long so that ndbz db's 
  301. !  * will work across NFS on 64 bit machines as well as 32 bit machines.
  302. !  */
  303. ! #define    of_t    int32
  304.   #define    SOF    (sizeof(of_t))
  305.   
  306.   /*
  307.  
  308. Index: hdrs/s_elm.h
  309. *** ../elm2.4/hdrs/s_elm.h    Mon May 31 15:35:18 1993
  310. --- hdrs/s_elm.h    Tue Aug  3 14:58:35 1993
  311. ***************
  312. *** 1,4 ****
  313. ! /* s_elm.h created from s_elm.us by gencat on Mon May 31 15:35:18 EDT 1993 */
  314.   
  315.   #define ElmSet    0x3
  316.   #define ElmYes    0x1
  317. --- 1,4 ----
  318. ! /* s_elm.h created from s_elm.us by gencat on Tue Aug  3 14:58:35 EDT 1993 */
  319.   
  320.   #define ElmSet    0x3
  321.   #define ElmYes    0x1
  322. ***************
  323. *** 499,505 ****
  324.   #define ElmTooManyWeedHeaders    0x233
  325.   #define ElmTooManyWeedPmalloc    0x234
  326.   #define ElmNoMemDefaultWeed    0x235
  327. ! #define ElmCantExpandEnvVar    0x236
  328.   #define ElmCouldntMakeTempFileName    0x237
  329.   #define ElmCouldntOpenForWriting    0x238
  330.   #define ElmSureYouWantToRemail    0x239
  331. --- 499,505 ----
  332.   #define ElmTooManyWeedHeaders    0x233
  333.   #define ElmTooManyWeedPmalloc    0x234
  334.   #define ElmNoMemDefaultWeed    0x235
  335. ! #define ElmCannotInitErrorExpanding    0x236
  336.   #define ElmCouldntMakeTempFileName    0x237
  337.   #define ElmCouldntOpenForWriting    0x238
  338.   #define ElmSureYouWantToRemail    0x239
  339.  
  340. Index: hdrs/save_opts.h
  341. Prereq: 5.8
  342. *** ../elm2.4/hdrs/save_opts.h    Sat May  8 16:02:01 1993
  343. --- hdrs/save_opts.h    Tue Aug 10 14:49:32 1993
  344. ***************
  345. *** 1,8 ****
  346.   
  347. ! /* @(#)$Id: save_opts.h,v 5.8 1993/05/08 18:56:16 syd Exp syd $ */
  348.   
  349.   /*******************************************************************************
  350. !  *  The Elm Mail System  -  $Revision: 5.8 $   $State: Exp $
  351.    *
  352.    *             Copyright (c) 1988-1992 USENET Community Trust
  353.    *             Copyright (c) 1986,1987 Dave Taylor
  354. --- 1,8 ----
  355.   
  356. ! /* @(#)$Id: save_opts.h,v 5.10 1993/08/10 18:49:32 syd Exp $ */
  357.   
  358.   /*******************************************************************************
  359. !  *  The Elm Mail System  -  $Revision: 5.10 $   $State: Exp $
  360.    *
  361.    *             Copyright (c) 1988-1992 USENET Community Trust
  362.    *             Copyright (c) 1986,1987 Dave Taylor
  363. ***************
  364. *** 14,19 ****
  365. --- 14,30 ----
  366.    *
  367.    *******************************************************************************
  368.    * $Log: save_opts.h,v $
  369. +  * Revision 5.10  1993/08/10  18:49:32  syd
  370. +  * When an environment variable was given as the tmpdir definition the src
  371. +  * and dest overlapped in expand_env.  This made elm produce a garbage
  372. +  * expansion because expand_env cannot cope with overlapping src and
  373. +  * dest.  I added a new variable raw_temp_dir to keep src and dest not to
  374. +  * overlap.
  375. +  * From: Jukka Ukkonen <ukkonen@csc.fi>
  376. +  *
  377. +  * Revision 5.9  1993/06/12  05:28:06  syd
  378. +  * Missing checkin
  379. +  *
  380.    * Revision 5.8  1993/05/08  18:56:16  syd
  381.    * created a new elmrc variable named "readmsginc".  This specifies an
  382.    * increment by which the message count is updated.  If this variable is
  383. ***************
  384. *** 230,236 ****
  385.   #endif
  386.   {"timeout",        -1L,DT_NUM,(char *)&timeout},
  387.   {"titles",        -1L,DT_BOL,(char *)&title_messages},
  388. ! {"tmpdir",        -1L,DT_STR,temp_dir},
  389.   {"userlevel",        -1L,DT_NUM,(char *)&user_level},
  390.   {"username",        -1L,DT_SYN,"fullname"},
  391.   {"usetite",        -1L,DT_BOL|FL_AND,(char *)&use_tite},
  392. --- 241,247 ----
  393.   #endif
  394.   {"timeout",        -1L,DT_NUM,(char *)&timeout},
  395.   {"titles",        -1L,DT_BOL,(char *)&title_messages},
  396. ! {"tmpdir",        -1L,DT_STR,raw_temp_dir},
  397.   {"userlevel",        -1L,DT_NUM,(char *)&user_level},
  398.   {"username",        -1L,DT_SYN,"fullname"},
  399.   {"usetite",        -1L,DT_BOL|FL_AND,(char *)&use_tite},
  400.  
  401. Index: lib/Makefile.SH
  402. Prereq: 5.11
  403. *** ../elm2.4/lib/Makefile.SH    Sun Apr 11 21:51:43 1993
  404. --- lib/Makefile.SH    Tue Aug  3 15:28:46 1993
  405. ***************
  406. *** 36,42 ****
  407.   
  408.   echo "Extracting lib/Makefile (with variable substitutions)"
  409.   cat >Makefile <<!GROK!THIS!
  410. ! # $Id: Makefile.SH,v 5.11 1993/04/12 01:51:42 syd Exp $
  411.   #
  412.   #  Makefile for the ELM mail program.
  413.   #
  414. --- 36,42 ----
  415.   
  416.   echo "Extracting lib/Makefile (with variable substitutions)"
  417.   cat >Makefile <<!GROK!THIS!
  418. ! # $Id: Makefile.SH,v 5.15 1993/08/03 19:28:39 syd Exp $
  419.   #
  420.   #  Makefile for the ELM mail program.
  421.   #
  422. ***************
  423. *** 49,54 ****
  424. --- 49,88 ----
  425.   #            dsinc!elm
  426.   #
  427.   # $Log: Makefile.SH,v $
  428. + # Revision 5.15  1993/08/03  19:28:39  syd
  429. + # Elm tries to replace the system toupper() and tolower() on current
  430. + # BSD systems, which is unnecessary.  Even worse, the replacements
  431. + # collide during linking with routines in isctype.o.  This patch adds
  432. + # a Configure test to determine whether replacements are really needed
  433. + # (BROKE_CTYPE definition).  The <ctype.h> header file is now included
  434. + # globally through hdrs/defs.h and the BROKE_CTYPE patchup is handled
  435. + # there.  Inclusion of <ctype.h> was removed from *all* the individual
  436. + # files, and the toupper() and tolower() routines in lib/opt_utils.c
  437. + # were dropped.
  438. + # From: chip@chinacat.unicom.com (Chip Rosenthal)
  439. + #
  440. + # Revision 5.14  1993/08/03  19:17:33  syd
  441. + # Implement new timezone handling.  New file lib/get_tz.c with new timezone
  442. + # routines.  Added new TZMINS_USE_xxxxxx and TZNAME_USE_xxxxxx configuration
  443. + # definitions.  Obsoleted TZNAME, ALTCHECK, and TZ_MINUTESWEST configuration
  444. + # definitions.  Updated Configure.  Modified lib/getarpdate.c and
  445. + # lib/strftime.c to use new timezone routines.
  446. + #
  447. + # From: chip@chinacat.unicom.com (Chip Rosenthal)
  448. + #
  449. + # Revision 5.13  1993/08/02  18:14:35  syd
  450. + # add missing references for mcprt.c/mcprtlib.c to defs.h
  451. + # From: Syd
  452. + #
  453. + # Revision 5.12  1993/06/10  03:02:46  syd
  454. + # break_down_tolist() tried to blindly split address lists at "," which
  455. + # caused bogus results with addreses that had a comma inside a comment
  456. + # or quoted text, such as "user@domain (Last, First)".  This patch steps
  457. + # through the address in quanta of RFC-822 tokens when searching for a
  458. + # delimiting comma.  It also adds "rfc822_toklen()" to the library to
  459. + # get that length.
  460. + # From: chip@chinacat.unicom.com (Chip Rosenthal)
  461. + #
  462.   # Revision 5.11  1993/04/12  01:51:42  syd
  463.   # Added safe_malloc(), safe_realloc(), and safe_strdup().  They
  464.   # will be used in the new elmalias utility.
  465. ***************
  466. *** 162,167 ****
  467. --- 196,202 ----
  468.               getarpdate.c    \
  469.               getfullnam.c    \
  470.               getword.c    \
  471. +             get_tz.c    \
  472.               header_cmp.c    \
  473.               in_list.c    \
  474.               in_string.c    \
  475. ***************
  476. *** 182,187 ****
  477. --- 217,223 ----
  478.               qstrings.c    \
  479.               remfirstwd.c    \
  480.               reverse.c    \
  481. +             rfc822tlen.c    \
  482.               safemalloc.c    \
  483.               shiftlower.c    \
  484.               strfcpy.c    \
  485. ***************
  486. *** 207,212 ****
  487. --- 243,249 ----
  488.               expand.o    \
  489.               figadrssee.o    \
  490.               gcos_name.o    \
  491. +             get_tz.o    \
  492.               getaddrfrm.o    \
  493.               getarpdate.o    \
  494.               getfullnam.o    \
  495. ***************
  496. *** 231,236 ****
  497. --- 268,274 ----
  498.               realfrom.o    \
  499.               remfirstwd.o    \
  500.               reverse.o    \
  501. +             rfc822tlen.o    \
  502.               safemalloc.o    \
  503.               shiftlower.o    \
  504.               strfcpy.o    \
  505. ***************
  506. *** 280,285 ****
  507. --- 318,324 ----
  508.   #    Dependencies of C object files
  509.   add_site.o:    $(INCLDIR)/headers.h
  510.   addrmchusr.o:    $(INCLDIR)/headers.h
  511. + atonum.o:    $(INCLDIR)/defs.h
  512.   mk_aliases.o:    $(INCLDIR)/headers.h $(INCLDIR)/ndbz.h $(INCLDIR)/s_newalias.h
  513.   aliasdb.o:    $(INCLDIR)/headers.h $(INCLDIR)/ndbz.h
  514.   mk_lockname.o:    $(INCLDIR)/headers.h
  515. ***************
  516. *** 291,296 ****
  517. --- 330,336 ----
  518.   expand.o:    $(INCLDIR)/defs.h $(INCLDIR)/s_elmrc.h
  519.   figadrssee.o:    $(INCLDIR)/headers.h
  520.   gcos_name.o:    $(INCLDIR)/headers.h
  521. + get_tz.o:    $(INCLDIR)/defs.h
  522.   getaddrfrm.o:    $(INCLDIR)/headers.h
  523.   getarpdate.o:    $(INCLDIR)/headers.h
  524.   getfullnam.o:    $(INCLDIR)/headers.h
  525. ***************
  526. *** 302,309 ****
  527.   ldstate.o:    $(INCLDIR)/defs.h
  528.   len_next.o:    ../config.h
  529.   mail_gets.o:    ../config.h
  530. ! mcprt.o:    $(INCLDIR)/mcprt.h $(INCLDIR)/mcprtlib.h
  531. ! mcprtlib.o:    $(INCLDIR)/mcprtlib.h $(INCLDIR)/nl_types.h
  532.   move_left.o:    $(INCLDIR)/headers.h
  533.   msgcat.o:    $(INCLDIR)/msgcat.h $(INCLDIR)/nl_types.h
  534.   ndbz.o:        $(INCLDIR)/headers.h $(INCLDIR)/ndbz.h
  535. --- 342,349 ----
  536.   ldstate.o:    $(INCLDIR)/defs.h
  537.   len_next.o:    ../config.h
  538.   mail_gets.o:    ../config.h
  539. ! mcprt.o:    $(INCLDIR)/mcprt.h $(INCLDIR)/mcprtlib.h $(INCLDIR)/defs.h
  540. ! mcprtlib.o:    $(INCLDIR)/mcprtlib.h $(INCLDIR)/nl_types.h $(INCLDIR)/defs.h
  541.   move_left.o:    $(INCLDIR)/headers.h
  542.   msgcat.o:    $(INCLDIR)/msgcat.h $(INCLDIR)/nl_types.h
  543.   ndbz.o:        $(INCLDIR)/headers.h $(INCLDIR)/ndbz.h
  544.  
  545. Index: lib/aliasdb.c
  546. Prereq: 5.3
  547. *** ../elm2.4/lib/aliasdb.c    Tue Apr 20 21:40:16 1993
  548. --- lib/aliasdb.c    Tue Aug  3 15:28:46 1993
  549. ***************
  550. *** 1,5 ****
  551.   /*******************************************************************************
  552. !  *  The Elm Mail System  -  $Revision: 5.3 $   $State: Exp $
  553.    *
  554.    *            Copyright (c) 1988-1992 USENET Community Trust
  555.    *            Copyright (c) 1986,1987 Dave Taylor
  556. --- 1,8 ----
  557. + static char rcsid[] = "@(#)$Id: aliasdb.c,v 5.7 1993/08/03 19:28:39 syd Exp $";
  558.   /*******************************************************************************
  559. !  *  The Elm Mail System  -  $Revision: 5.7 $   $State: Exp $
  560.    *
  561.    *            Copyright (c) 1988-1992 USENET Community Trust
  562.    *            Copyright (c) 1986,1987 Dave Taylor
  563. ***************
  564. *** 11,16 ****
  565. --- 14,46 ----
  566.    *
  567.    *******************************************************************************
  568.    * $Log: aliasdb.c,v $
  569. +  * Revision 5.7  1993/08/03  19:28:39  syd
  570. +  * Elm tries to replace the system toupper() and tolower() on current
  571. +  * BSD systems, which is unnecessary.  Even worse, the replacements
  572. +  * collide during linking with routines in isctype.o.  This patch adds
  573. +  * a Configure test to determine whether replacements are really needed
  574. +  * (BROKE_CTYPE definition).  The <ctype.h> header file is now included
  575. +  * globally through hdrs/defs.h and the BROKE_CTYPE patchup is handled
  576. +  * there.  Inclusion of <ctype.h> was removed from *all* the individual
  577. +  * files, and the toupper() and tolower() routines in lib/opt_utils.c
  578. +  * were dropped.
  579. +  * From: chip@chinacat.unicom.com (Chip Rosenthal)
  580. +  *
  581. +  * Revision 5.6  1993/07/20  02:59:53  syd
  582. +  * Support aliases both on 64 bit and 32 bit machines at the same time.
  583. +  * From: Dan Mosedale <mosedale@genome.stanford.edu>
  584. +  *
  585. +  * Revision 5.5  1993/06/10  03:12:10  syd
  586. +  * Add missing rcs id lines
  587. +  * From: Syd
  588. +  *
  589. +  * Revision 5.4  1993/06/10  02:58:26  syd
  590. +  * Correct problem in fetch_alias() with alias record fixup that caused
  591. +  * core dump on machines with pointers larger than int.  This problem
  592. +  * was reported on comp.mail.elm by Richard Eckman and Jim Brown.  Simplify
  593. +  * get_one_alias() by having it use fetch_alias().
  594. +  * From: chip@chinacat.unicom.com (Chip Rosenthal)
  595. +  *
  596.    * Revision 5.3  1993/04/21  01:40:12  syd
  597.    * add seekset define
  598.    *
  599. ***************
  600. *** 35,41 ****
  601.   **/
  602.   
  603.   #include "headers.h"
  604. - #include <ctype.h>
  605.   #include "ndbz.h"
  606.   
  607.   #ifndef SEEK_SET
  608. --- 65,70 ----
  609. ***************
  610. *** 46,53 ****
  611.   
  612.   #ifdef BSD
  613.   #  include <sys/file.h>
  614. - #  undef tolower
  615. - #  undef toupper
  616.   #endif
  617.   
  618.   /* byte-ordering stuff */
  619. --- 75,80 ----
  620. ***************
  621. *** 74,82 ****
  622.       return(out.o);
  623.   }
  624.   
  625. ! read_one_alias(db, ar)
  626.   DBZ *db;
  627. ! struct alias_rec *ar;
  628.   {
  629.   /*
  630.    *    Read an alias (name, address, etc.) from the data file
  631. --- 101,109 ----
  632.       return(out.o);
  633.   }
  634.   
  635. ! read_one_alias(db, adr)
  636.   DBZ *db;
  637. ! struct alias_disk_rec *adr;
  638.   {
  639.   /*
  640.    *    Read an alias (name, address, etc.) from the data file
  641. ***************
  642. *** 87,103 ****
  643.       if (data_file == NULL)
  644.           return(0);    /* no alias file, but hash exists, error condition */
  645.   
  646. !     if (fread((char *) ar, sizeof(struct alias_rec), 1, data_file) <= 0)
  647. !         return(0);
  648. !     ar->status = (int) MAPIN(ar->status);
  649. !     ar->alias = (char *) MAPIN(ar->alias);
  650. !     ar->last_name = (char *) MAPIN(ar->last_name);
  651. !     ar->name = (char *) MAPIN(ar->name);
  652. !     ar->comment = (char *) MAPIN(ar->comment);
  653. !     ar->address = (char *) MAPIN(ar->address);
  654. !     ar->type = (int) MAPIN(ar->type);
  655. !     ar->length = (long) MAPIN(ar->length);
  656.   
  657.       return(1);
  658.   }
  659. --- 114,131 ----
  660.       if (data_file == NULL)
  661.           return(0);    /* no alias file, but hash exists, error condition */
  662.   
  663. !     if (fread((char *) adr, sizeof(struct alias_disk_rec), 1, data_file)
  664. !         <= 0)
  665. !         return(0);
  666. !     adr->status = (int32) MAPIN(adr->status);
  667. !     adr->alias = (int32) MAPIN(adr->alias);
  668. !     adr->last_name = (int32) MAPIN(adr->last_name);
  669. !     adr->name = (int32) MAPIN(adr->name);
  670. !     adr->comment = (int32) MAPIN(adr->comment);
  671. !     adr->address = (int32) MAPIN(adr->address);
  672. !     adr->type = (int32) MAPIN(adr->type);
  673. !     adr->length = (int32) MAPIN(adr->length);
  674.   
  675.       return(1);
  676.   }
  677. ***************
  678. *** 122,128 ****
  679.   char *alias;
  680.   {
  681.       datum key, val;
  682. !     struct alias_rec arec;
  683.       long pos;
  684.       register struct alias_rec *ar;
  685.       register char *buf, *s;
  686. --- 150,156 ----
  687.   char *alias;
  688.   {
  689.       datum key, val;
  690. !     struct alias_disk_rec adrec;
  691.       long pos;
  692.       register struct alias_rec *ar;
  693.       register char *buf, *s;
  694. ***************
  695. *** 159,194 ****
  696.           /*
  697.            * Move to the position of the selected alias record.
  698.            */
  699. !         pos = *((long *)(val.dptr)) - sizeof(struct alias_rec);
  700.           if (fseek(db->dbz_basef, pos, SEEK_SET) != 0)
  701.               return (struct alias_rec *)NULL;
  702.   
  703.       }
  704.   
  705.       /*
  706.        * We are now positioned at the alias record we want.  Pull it in.
  707.        */
  708. !     if (!read_one_alias(db, &arec))
  709.           return (struct alias_rec *)NULL;
  710.   
  711.       /*
  712.        * Allocate space to hold the alias record and data content.
  713.        */
  714.       ar = (struct alias_rec *)
  715. !         safe_malloc(sizeof(struct alias_rec) + arec.length);
  716. !     *ar = arec;
  717.       buf = (char *)ar + sizeof(struct alias_rec);
  718.   
  719.       /*
  720. !      * Read in the data content and fixup pointers in the alias record.
  721.        */
  722.       if (fread(buf, ar->length, 1, db->dbz_basef) != 1)
  723.           return (struct alias_rec *)NULL;
  724. -     ar->alias += (int) buf;
  725. -     ar->last_name += (int) buf;
  726. -     ar->name += (int) buf;
  727. -     ar->comment += (int) buf;
  728. -     ar->address += (int) buf;
  729.   
  730.       return ar;
  731.   }
  732. --- 187,241 ----
  733.           /*
  734.            * Move to the position of the selected alias record.
  735.            */
  736. !         pos = *((long *)(val.dptr)) - sizeof(struct alias_disk_rec);
  737.           if (fseek(db->dbz_basef, pos, SEEK_SET) != 0)
  738.               return (struct alias_rec *)NULL;
  739.   
  740.       }
  741.   
  742.       /*
  743. +      * Each alias in the data file is stored as a (struct alias_rec)
  744. +      * followed by text information for that alias record.  The
  745. +      * size of the following text information is specified by `length',
  746. +      * and the value of the other members of the structure are actually
  747. +      * offsets into that buffer space.  So, to load in an alias we
  748. +      * need to:  (1) read the alias record, (2) see how long the data
  749. +      * buffer is and pull it in, and (3) fixup the pointers in the
  750. +      * alias record so they point into the data buffer.
  751. +      */
  752. +     /*
  753.        * We are now positioned at the alias record we want.  Pull it in.
  754.        */
  755. !     if (!read_one_alias(db, &adrec))
  756.           return (struct alias_rec *)NULL;
  757.   
  758.       /*
  759.        * Allocate space to hold the alias record and data content.
  760.        */
  761.       ar = (struct alias_rec *)
  762. !         safe_malloc(sizeof(struct alias_rec) + (size_t)adrec.length);
  763.       buf = (char *)ar + sizeof(struct alias_rec);
  764.   
  765. +         /* 
  766. +      * Fixup pointers in the alias record.
  767. +      */
  768. +     ar->status = (int)adrec.status;
  769. +     ar->alias = (char *) ((size_t) adrec.alias + (size_t) buf);
  770. +     ar->last_name = (char *) ((size_t) adrec.last_name + (size_t) buf);
  771. +     ar->name = (char *) ((size_t) adrec.name + (size_t) buf);
  772. +     ar->comment = (char *) ((size_t) adrec.comment + (size_t) buf);
  773. +     ar->address = (char *) ((size_t) adrec.address + (size_t) buf);
  774. +     ar->type = (int)adrec.type;
  775. +     ar->length = (size_t)adrec.length;
  776.       /*
  777. !      * Read in the data content 
  778.        */
  779.       if (fread(buf, ar->length, 1, db->dbz_basef) != 1)
  780.           return (struct alias_rec *)NULL;
  781.   
  782.       return ar;
  783.   }
  784.  
  785. Index: lib/atonum.c
  786. Prereq: 5.1
  787. *** ../elm2.4/lib/atonum.c    Mon Jan 18 23:46:39 1993
  788. --- lib/atonum.c    Tue Aug  3 15:28:47 1993
  789. ***************
  790. *** 1,8 ****
  791.   
  792. ! static char rcsid[] = "@(#)$Id: atonum.c,v 5.1 1993/01/19 04:46:21 syd Exp $";
  793.   
  794.   /*******************************************************************************
  795. !  *  The Elm Mail System  -  $Revision: 5.1 $   $State: Exp $
  796.    *
  797.    *             Copyright (c) 1993 USENET Community Trust
  798.    *******************************************************************************
  799. --- 1,8 ----
  800.   
  801. ! static char rcsid[] = "@(#)$Id: atonum.c,v 5.2 1993/08/03 19:28:39 syd Exp $";
  802.   
  803.   /*******************************************************************************
  804. !  *  The Elm Mail System  -  $Revision: 5.2 $   $State: Exp $
  805.    *
  806.    *             Copyright (c) 1993 USENET Community Trust
  807.    *******************************************************************************
  808. ***************
  809. *** 13,25 ****
  810.    *
  811.    *******************************************************************************
  812.    * $Log: atonum.c,v $
  813.    * Revision 5.1  1993/01/19  04:46:21  syd
  814.    * Initial Checkin
  815.    *
  816.    *
  817.    ******************************************************************************/
  818.   
  819. ! #include <ctype.h>
  820.   
  821.   /*
  822.    * This is similar to atoi(), but it complains if the string
  823. --- 13,37 ----
  824.    *
  825.    *******************************************************************************
  826.    * $Log: atonum.c,v $
  827. +  * Revision 5.2  1993/08/03  19:28:39  syd
  828. +  * Elm tries to replace the system toupper() and tolower() on current
  829. +  * BSD systems, which is unnecessary.  Even worse, the replacements
  830. +  * collide during linking with routines in isctype.o.  This patch adds
  831. +  * a Configure test to determine whether replacements are really needed
  832. +  * (BROKE_CTYPE definition).  The <ctype.h> header file is now included
  833. +  * globally through hdrs/defs.h and the BROKE_CTYPE patchup is handled
  834. +  * there.  Inclusion of <ctype.h> was removed from *all* the individual
  835. +  * files, and the toupper() and tolower() routines in lib/opt_utils.c
  836. +  * were dropped.
  837. +  * From: chip@chinacat.unicom.com (Chip Rosenthal)
  838. +  *
  839.    * Revision 5.1  1993/01/19  04:46:21  syd
  840.    * Initial Checkin
  841.    *
  842.    *
  843.    ******************************************************************************/
  844.   
  845. ! #include "defs.h"
  846.   
  847.   /*
  848.    * This is similar to atoi(), but it complains if the string
  849.  
  850. Index: lib/can_access.c
  851. Prereq: 5.6
  852. *** ../elm2.4/lib/can_access.c    Thu May 13 23:52:11 1993
  853. --- lib/can_access.c    Sun Aug 22 22:46:07 1993
  854. ***************
  855. *** 1,8 ****
  856.   
  857. ! static char rcsid[] = "@(#)$Id: can_access.c,v 5.6 1993/05/14 03:52:10 syd Exp $";
  858.   
  859.   /*******************************************************************************
  860. !  *  The Elm Mail System  -  $Revision: 5.6 $   $State: Exp $
  861.    *
  862.    *            Copyright (c) 1988-1992 USENET Community Trust
  863.    *            Copyright (c) 1986,1987 Dave Taylor
  864. --- 1,8 ----
  865.   
  866. ! static char rcsid[] = "@(#)$Id: can_access.c,v 5.8 1993/08/23 02:46:07 syd Exp $";
  867.   
  868.   /*******************************************************************************
  869. !  *  The Elm Mail System  -  $Revision: 5.8 $   $State: Exp $
  870.    *
  871.    *            Copyright (c) 1988-1992 USENET Community Trust
  872.    *            Copyright (c) 1986,1987 Dave Taylor
  873. ***************
  874. *** 14,19 ****
  875. --- 14,35 ----
  876.    *
  877.    *******************************************************************************
  878.    * $Log: can_access.c,v $
  879. +  * Revision 5.8  1993/08/23  02:46:07  syd
  880. +  * Don't declare _exit() if <unistd.h> already did it.
  881. +  * From: decwrl!uunet.UU.NET!fin!chip (Chip Salzenberg)
  882. +  *
  883. +  * Revision 5.7  1993/08/03  19:28:39  syd
  884. +  * Elm tries to replace the system toupper() and tolower() on current
  885. +  * BSD systems, which is unnecessary.  Even worse, the replacements
  886. +  * collide during linking with routines in isctype.o.  This patch adds
  887. +  * a Configure test to determine whether replacements are really needed
  888. +  * (BROKE_CTYPE definition).  The <ctype.h> header file is now included
  889. +  * globally through hdrs/defs.h and the BROKE_CTYPE patchup is handled
  890. +  * there.  Inclusion of <ctype.h> was removed from *all* the individual
  891. +  * files, and the toupper() and tolower() routines in lib/opt_utils.c
  892. +  * were dropped.
  893. +  * From: chip@chinacat.unicom.com (Chip Rosenthal)
  894. +  *
  895.    * Revision 5.6  1993/05/14  03:52:10  syd
  896.    * When compiled on a POSIX host PL22 failed checking whether the file is
  897.    * readable and a regular file or not. There was one `!' missing in the
  898. ***************
  899. *** 48,60 ****
  900.   
  901.   #include "headers.h"
  902.   #include <sys/stat.h>
  903. - #include <ctype.h>
  904.   #include <errno.h>
  905.   
  906.   #ifdef BSD
  907.   # include <sys/wait.h>
  908.   #endif
  909.   
  910.   extern int errno;        /* system error number */
  911.   
  912.   int
  913. --- 64,79 ----
  914.   
  915.   #include "headers.h"
  916.   #include <sys/stat.h>
  917.   #include <errno.h>
  918.   
  919.   #ifdef BSD
  920.   # include <sys/wait.h>
  921.   #endif
  922.   
  923. + #ifndef I_UNISTD
  924. + void _exit();
  925. + #endif
  926.   extern int errno;        /* system error number */
  927.   
  928.   int
  929. ***************
  930. *** 66,72 ****
  931.   
  932.       int the_stat = 0, pid, w; 
  933.       struct stat stat_buf;
  934. -     void _exit();
  935.   #if defined(BSD) && !defined(WEXITSTATUS)
  936.       union wait status;
  937.   #else
  938. --- 85,90 ----
  939.  
  940. Index: lib/can_open.c
  941. Prereq: 5.2
  942. *** ../elm2.4/lib/can_open.c    Fri Dec 11 20:29:27 1992
  943. --- lib/can_open.c    Sun Aug 22 22:46:08 1993
  944. ***************
  945. *** 1,8 ****
  946.   
  947. ! static char rcsid[] = "@(#)$Id: can_open.c,v 5.2 1992/12/12 01:29:26 syd Exp $";
  948.   
  949.   /*******************************************************************************
  950. !  *  The Elm Mail System  -  $Revision: 5.2 $   $State: Exp $
  951.    *
  952.    *            Copyright (c) 1988-1992 USENET Community Trust
  953.    *            Copyright (c) 1986,1987 Dave Taylor
  954. --- 1,8 ----
  955.   
  956. ! static char rcsid[] = "@(#)$Id: can_open.c,v 5.4 1993/08/23 02:46:07 syd Exp $";
  957.   
  958.   /*******************************************************************************
  959. !  *  The Elm Mail System  -  $Revision: 5.4 $   $State: Exp $
  960.    *
  961.    *            Copyright (c) 1988-1992 USENET Community Trust
  962.    *            Copyright (c) 1986,1987 Dave Taylor
  963. ***************
  964. *** 14,19 ****
  965. --- 14,35 ----
  966.    *
  967.    *******************************************************************************
  968.    * $Log: can_open.c,v $
  969. +  * Revision 5.4  1993/08/23  02:46:07  syd
  970. +  * Don't declare _exit() if <unistd.h> already did it.
  971. +  * From: decwrl!uunet.UU.NET!fin!chip (Chip Salzenberg)
  972. +  *
  973. +  * Revision 5.3  1993/08/03  19:28:39  syd
  974. +  * Elm tries to replace the system toupper() and tolower() on current
  975. +  * BSD systems, which is unnecessary.  Even worse, the replacements
  976. +  * collide during linking with routines in isctype.o.  This patch adds
  977. +  * a Configure test to determine whether replacements are really needed
  978. +  * (BROKE_CTYPE definition).  The <ctype.h> header file is now included
  979. +  * globally through hdrs/defs.h and the BROKE_CTYPE patchup is handled
  980. +  * there.  Inclusion of <ctype.h> was removed from *all* the individual
  981. +  * files, and the toupper() and tolower() routines in lib/opt_utils.c
  982. +  * were dropped.
  983. +  * From: chip@chinacat.unicom.com (Chip Rosenthal)
  984. +  *
  985.    * Revision 5.2  1992/12/12  01:29:26  syd
  986.    * Fix double inclusion of sys/types.h
  987.    * From: Tom Moore <tmoore@wnas.DaytonOH.NCR.COM>
  988. ***************
  989. *** 30,42 ****
  990.   
  991.   #include "headers.h"
  992.   #include <sys/stat.h>
  993. - #include <ctype.h>
  994.   #include <errno.h>
  995.   
  996.   #ifdef BSD
  997.   # include <sys/wait.h>
  998.   #endif
  999.   
  1000.   extern int errno;        /* system error number */
  1001.   
  1002.   int
  1003. --- 46,61 ----
  1004.   
  1005.   #include "headers.h"
  1006.   #include <sys/stat.h>
  1007.   #include <errno.h>
  1008.   
  1009.   #ifdef BSD
  1010.   # include <sys/wait.h>
  1011.   #endif
  1012.   
  1013. + #ifndef I_UNISTD
  1014. + void _exit();
  1015. + #endif
  1016.   extern int errno;        /* system error number */
  1017.   
  1018.   int
  1019. ***************
  1020. *** 49,55 ****
  1021.   
  1022.       FILE *fd;
  1023.       int the_stat = 0, pid, w, preexisted = 0; 
  1024. -     void _exit();
  1025.   #if defined(BSD) && !defined(WEXITSTATUS)
  1026.       union wait status;
  1027.   #else
  1028. --- 68,73 ----
  1029.  
  1030. Index: lib/date_util.c
  1031. Prereq: 5.2
  1032. *** ../elm2.4/lib/date_util.c    Wed Jan 27 15:54:25 1993
  1033. --- lib/date_util.c    Tue Aug  3 15:28:48 1993
  1034. ***************
  1035. *** 1,8 ****
  1036.   
  1037. ! static char rcsid[] = "@(#)$Id: date_util.c,v 5.2 1993/01/27 20:54:24 syd Exp $";
  1038.   
  1039.   /*******************************************************************************
  1040. !  *  The Elm Mail System  -  $Revision: 5.2 $   $State: Exp $
  1041.    *
  1042.    *             Copyright (c) 1993 USENET Community Trust
  1043.    *******************************************************************************
  1044. --- 1,8 ----
  1045.   
  1046. ! static char rcsid[] = "@(#)$Id: date_util.c,v 5.3 1993/08/03 19:28:39 syd Exp $";
  1047.   
  1048.   /*******************************************************************************
  1049. !  *  The Elm Mail System  -  $Revision: 5.3 $   $State: Exp $
  1050.    *
  1051.    *             Copyright (c) 1993 USENET Community Trust
  1052.    *******************************************************************************
  1053. ***************
  1054. *** 13,18 ****
  1055. --- 13,30 ----
  1056.    *
  1057.    *******************************************************************************
  1058.    * $Log: date_util.c,v $
  1059. +  * Revision 5.3  1993/08/03  19:28:39  syd
  1060. +  * Elm tries to replace the system toupper() and tolower() on current
  1061. +  * BSD systems, which is unnecessary.  Even worse, the replacements
  1062. +  * collide during linking with routines in isctype.o.  This patch adds
  1063. +  * a Configure test to determine whether replacements are really needed
  1064. +  * (BROKE_CTYPE definition).  The <ctype.h> header file is now included
  1065. +  * globally through hdrs/defs.h and the BROKE_CTYPE patchup is handled
  1066. +  * there.  Inclusion of <ctype.h> was removed from *all* the individual
  1067. +  * files, and the toupper() and tolower() routines in lib/opt_utils.c
  1068. +  * were dropped.
  1069. +  * From: chip@chinacat.unicom.com (Chip Rosenthal)
  1070. +  *
  1071.    * Revision 5.2  1993/01/27  20:54:24  syd
  1072.    * There is a small bug in this routine in Chip's PL21 patch.  The code
  1073.    * calls atonum to convert the 4 digit timezone field.  However this field
  1074. ***************
  1075. *** 27,33 ****
  1076.    ******************************************************************************/
  1077.   
  1078.   #include "headers.h"
  1079. - #include <ctype.h>
  1080.   
  1081.   /*
  1082.    * Date processing functions:
  1083. --- 39,44 ----
  1084.  
  1085. Index: lib/figadrssee.c
  1086. Prereq: 5.2
  1087. *** ../elm2.4/lib/figadrssee.c    Wed Feb  3 11:25:46 1993
  1088. --- lib/figadrssee.c    Sat Jun 12 01:33:39 1993
  1089. ***************
  1090. *** 1,8 ****
  1091.   
  1092. ! static char rcsid[] = "@(#)$Id: figadrssee.c,v 5.2 1993/02/03 16:25:45 syd Exp $";
  1093.   
  1094.   /*******************************************************************************
  1095. !  *  The Elm Mail System  -  $Revision: 5.2 $   $State: Exp $
  1096.    *
  1097.    *            Copyright (c) 1988-1992 USENET Community Trust
  1098.    *            Copyright (c) 1986,1987 Dave Taylor
  1099. --- 1,8 ----
  1100.   
  1101. ! static char rcsid[] = "@(#)$Id: figadrssee.c,v 5.3 1993/06/12 05:33:32 syd Exp $";
  1102.   
  1103.   /*******************************************************************************
  1104. !  *  The Elm Mail System  -  $Revision: 5.3 $   $State: Exp $
  1105.    *
  1106.    *            Copyright (c) 1988-1992 USENET Community Trust
  1107.    *            Copyright (c) 1986,1987 Dave Taylor
  1108. ***************
  1109. *** 14,19 ****
  1110. --- 14,23 ----
  1111.    *
  1112.    *******************************************************************************
  1113.    * $Log: figadrssee.c,v $
  1114. +  * Revision 5.3  1993/06/12  05:33:32  syd
  1115. +  * Remove useless auto
  1116. +  * From: Syd
  1117. +  *
  1118.    * Revision 5.2  1993/02/03  16:25:45  syd
  1119.    * Adresses with double quoted strings that contains comma was parsed
  1120.    * wrongly by break_down_tolist() and figure_out_addressee().
  1121. ***************
  1122. *** 42,48 ****
  1123.       **/
  1124.   
  1125.       char *address, *bufptr, mybuf[SLEN];
  1126. -     register int index2 = 0;
  1127.       
  1128.       if (equal(mail_to, username)) return;    /* can't be better! */
  1129.   
  1130. --- 46,51 ----
  1131.  
  1132. Index: lib/gcos_name.c
  1133. Prereq: 5.2
  1134. *** ../elm2.4/lib/gcos_name.c    Tue Jan 19 22:02:33 1993
  1135. --- lib/gcos_name.c    Tue Aug  3 15:28:49 1993
  1136. ***************
  1137. *** 1,7 ****
  1138. ! static char rcsid[] = "@(#)$Id: gcos_name.c,v 5.2 1993/01/20 03:02:19 syd Exp $";
  1139.   
  1140.   /*******************************************************************************
  1141. !  *  The Elm Mail System  -  $Revision: 5.2 $   $State: Exp $
  1142.    *
  1143.    *            Copyright (c) 1988-1992 USENET Community Trust
  1144.    *            Copyright (c) 1986,1987 Dave Taylor
  1145. --- 1,7 ----
  1146. ! static char rcsid[] = "@(#)$Id: gcos_name.c,v 5.3 1993/08/03 19:28:39 syd Exp $";
  1147.   
  1148.   /*******************************************************************************
  1149. !  *  The Elm Mail System  -  $Revision: 5.3 $   $State: Exp $
  1150.    *
  1151.    *            Copyright (c) 1988-1992 USENET Community Trust
  1152.    *            Copyright (c) 1986,1987 Dave Taylor
  1153. ***************
  1154. *** 13,18 ****
  1155. --- 13,30 ----
  1156.    *
  1157.    *******************************************************************************
  1158.    * $Log: gcos_name.c,v $
  1159. +  * Revision 5.3  1993/08/03  19:28:39  syd
  1160. +  * Elm tries to replace the system toupper() and tolower() on current
  1161. +  * BSD systems, which is unnecessary.  Even worse, the replacements
  1162. +  * collide during linking with routines in isctype.o.  This patch adds
  1163. +  * a Configure test to determine whether replacements are really needed
  1164. +  * (BROKE_CTYPE definition).  The <ctype.h> header file is now included
  1165. +  * globally through hdrs/defs.h and the BROKE_CTYPE patchup is handled
  1166. +  * there.  Inclusion of <ctype.h> was removed from *all* the individual
  1167. +  * files, and the toupper() and tolower() routines in lib/opt_utils.c
  1168. +  * were dropped.
  1169. +  * From: chip@chinacat.unicom.com (Chip Rosenthal)
  1170. +  *
  1171.    * Revision 5.2  1993/01/20  03:02:19  syd
  1172.    * Move string declarations to defs.h
  1173.    * From: Syd
  1174. ***************
  1175. *** 28,39 ****
  1176.   **/
  1177.   
  1178.   #include "headers.h"
  1179. - #include <ctype.h>
  1180. - #ifdef BSD 
  1181. - #undef tolower
  1182. - #undef toupper
  1183. - #endif
  1184.   
  1185.   char *
  1186.   gcos_name(gcos_field, logname)
  1187. --- 40,45 ----
  1188.  
  1189. Index: lib/get_tz.c
  1190. *** /dev/null    Sun Aug 22 23:14:45 1993
  1191. --- lib/get_tz.c    Tue Aug 10 14:57:50 1993
  1192. ***************
  1193. *** 0 ****
  1194. --- 1,298 ----
  1195. + static char rcsid[] = "@(#)$Id: get_tz.c,v 5.1 1993/08/10 18:56:53 syd Exp $";
  1196. + /*******************************************************************************
  1197. +  *  The Elm Mail System  -  $Revision: 5.1 $   $State: Exp $
  1198. +  *
  1199. +  *             Copyright (c) 1992, 1993 USENET Community Trust
  1200. +  *******************************************************************************
  1201. +  * Bug reports, patches, comments, suggestions should be sent to:
  1202. +  *
  1203. +  *    Syd Weinstein, Elm Coordinator
  1204. +  *    elm@DSI.COM            dsinc!elm
  1205. +  *
  1206. +  *******************************************************************************
  1207. +  * $Log: get_tz.c,v $
  1208. +  * Revision 5.1  1993/08/10  18:56:53  syd
  1209. +  * Initial Checkin
  1210. +  *
  1211. +  *
  1212. +  ******************************************************************************/
  1213. + /*
  1214. +  * get_tz - Site-specific timezone handling.
  1215. +  *
  1216. +  * get_tz_mins(tm) - Return timezone adjustment in minutes west of GMT.
  1217. +  * get_tz_name(tm) - Return timezone name.
  1218. +  *
  1219. +  * These procedures return timezone infomation for the time specified by "tm".
  1220. +  * If "tm" is NULL, then the local, current timezone info are returned.
  1221. +  *
  1222. +  * On some systems, regardless of the "tm" value, the local timezone
  1223. +  * values are returned.
  1224. +  *
  1225. +  * On some systems, when passing a non-NULL "tm" value, a call to "tzset()"
  1226. +  * must be performed prior to invoking these routines to obtain proper
  1227. +  * timezone information.  Note that some systems will implicitly call
  1228. +  * "tzset()" through other routines, such as "localtime()".  On such
  1229. +  * systems an explicit "tzset()" is not required if the "tm" value was
  1230. +  * obtained through a routine that does the implicit setup.
  1231. +  *
  1232. +  * The task of discovering timezone info is a horrid mess because so many
  1233. +  * systems have different notions about how to do it.  The goal of these
  1234. +  * routines is to encapsulate the system dependancies here.  Two definitions,
  1235. +  * TZMINS_USE_xxxxxx and TZNAME_USE_xxxxxx must be enabled as appropriate
  1236. +  * for this system.  Exactly _one_ definition from each group must be
  1237. +  * specified.  The available choices are:
  1238. +  *
  1239. +  * TZMINS_USE_xxxxxx specifies how to get timezone offset.
  1240. +  *
  1241. +  *    TZMINS_USE_TM_TZADJ    use (struct tm*)->tm_tzadj
  1242. +  *    TZMINS_USE_TM_GMTOFF   use (struct tm*)->tm_gmtoff
  1243. +  *    TZMINS_USE_TZAZ_GLOBAL use "timezone, altzone" externals
  1244. +  *    TZMINS_USE_TZ_GLOBAL   use "timezone" external
  1245. +  *    TZMINS_USE_FTIME       use ftime() function
  1246. +  *    TZMINS_USE_TIMEOFDAY   use gettimeofday() function
  1247. +  *
  1248. +  * TZNAME_USE_xxxxxx specifies how to get timezone name.
  1249. +  *
  1250. +  *    TZNAME_USE_TM_NAME     use (struct tm *)->tm_name
  1251. +  *    TZNAME_USE_TM_ZONE     use (struct tm *)->tm_zone
  1252. +  *    TZNAME_USE_TZNAME      use "tzname[]" external
  1253. +  *    TZNAME_USE_TIMEZONE    use timezone() function
  1254. +  *
  1255. +  * The TZMINS_HANDLING and TZNAME_HANDLING definitions are just used
  1256. +  * to verify the configurations were setup correctly.  They force
  1257. +  * compiler warnings and/or errors in the event of a configuration problem.
  1258. +  */
  1259. + #include "defs.h"
  1260. + #ifdef I_TIME
  1261. + #  include <time.h>
  1262. + #endif
  1263. + #ifdef I_SYSTIME
  1264. + #  include <sys/time.h>
  1265. + #endif
  1266. + #ifdef TZMINS_USE_FTIME
  1267. + #  include <sys/timeb.h>
  1268. + #endif
  1269. + #ifndef    _POSIX_SOURCE
  1270. + extern struct tm *localtime();
  1271. + extern time_t      time();
  1272. + #endif
  1273. + /****************************************************************************/
  1274. + int get_tz_mins(tm)
  1275. + struct tm *tm;
  1276. + {
  1277. +     if (tm == 0) {
  1278. +         time_t t;
  1279. +         (void) time(&t);
  1280. +         tm = localtime(&t);
  1281. +     }
  1282. + #ifdef TZMINS_USE_TM_TZADJ
  1283. + #define TZMINS_HANDLING 1
  1284. +     /*
  1285. +      * This system maintains the timezone offset in the (struct tm)
  1286. +      * as a number of _seconds_ west of GMT.
  1287. +      */
  1288. +     return (int)(tm->tm_tzadj / 60);
  1289. + #endif
  1290. + #ifdef TZMINS_USE_TM_GMTOFF
  1291. + #define TZMINS_HANDLING 2
  1292. +     /*
  1293. +      * This system maintains the timezone offset in the (struct tm)
  1294. +      * as a number of _seconds_ _east_ of GMT.  Since this is an
  1295. +      * easterly pointing offset, we need to flip the sign to go the
  1296. +      * other direction.
  1297. +      */
  1298. +     return (int)(-tm->tm_gmtoff / 60);
  1299. + #endif
  1300. + #ifdef TZMINS_USE_TZAZ_GLOBAL
  1301. + #define TZMINS_HANDLING 3
  1302. +     /*
  1303. +      * This system maintains timezone offsets in global variables
  1304. +      * as a number of _seconds_ west of GMT.  There are two globals,
  1305. +      * one for when DST is in effect and one for when it is not,
  1306. +      * and we need to select the correct one.
  1307. +      */
  1308. +     {
  1309. +         extern long altzone, timezone;
  1310. +         return (int)((tm->tm_isdst ? altzone : timezone) / 60);
  1311. +     }
  1312. + #endif
  1313. + #ifdef TZMINS_USE_TZ_GLOBAL
  1314. + #define TZMINS_HANDLING 4
  1315. +     /*
  1316. +      * This system maintains the timezone offset in a global variable as
  1317. +      * a number of _seconds_ west of GMT.  We need to correct this value
  1318. +      * if DST is in effect.  Note that the global "daylight" indicates
  1319. +      * that DST applies to this site and NOT necessarily that the DST
  1320. +      * correction needs to be applied right now.  Be careful -- some
  1321. +      * systems have a "timezone()" procedure and this method will return
  1322. +      * the address of that procedure rather than a timezone offset!
  1323. +      */
  1324. +     {
  1325. +         extern long timezone;
  1326. +         extern int daylight;
  1327. +         return (int)(timezone/60) -
  1328. +             ((daylight && tm->tm_isdst) ? 60 : 0);
  1329. +     }
  1330. + #endif
  1331. + #ifdef TZMINS_USE_TIMEOFDAY
  1332. + #define TZMINS_HANDLING 5
  1333. +     /*
  1334. +      * This system uses gettimeofday() to obtain the timezone
  1335. +      * information as minutes west of GMT.  The returned value will
  1336. +      * not be corrected for DST (unless you are unlucky enough to
  1337. +      * own a Unix written by some unmentionable vendor), so we will
  1338. +      * need to account for that.  Be careful -- some systems that
  1339. +      * have this procedure depreciate its use for timezone information
  1340. +      * and recommend it only for the high-resolution time information.
  1341. +      * On these systems the timezone info may be some kernel default
  1342. +      * or even garbage.
  1343. +      */
  1344. +     {
  1345. +         struct timeval tv;
  1346. +         struct timezone tz;
  1347. +         (void) gettimeofday(&tv, &tz);
  1348. + #ifdef AIX
  1349. +         return tz.tz_minuteswest;
  1350. + #else
  1351. +         return tz.tz_minuteswest -
  1352. +             (tm->tm_isdst && tz.tz_dsttime != DST_NONE ? 60 : 0);
  1353. + #endif
  1354. +     }
  1355. + #endif
  1356. + #ifdef TZMINS_USE_FTIME
  1357. + #define TZMINS_HANDLING 6
  1358. +     /*
  1359. +      * This system uses ftime() to obtain the timezone information
  1360. +      * as minutes west of GMT.  The returned value will not be
  1361. +      * corrected for DST, so we will need to account for that.  Be
  1362. +      * careful -- some systems that have this procedure depreciate
  1363. +      * its use for timezone information and recommend it only for
  1364. +      * the high-resolution time information.  On these systems the
  1365. +      * timezone info may be some kernel default or even garbage.
  1366. +      */
  1367. +     {
  1368. +         struct timeb tb;
  1369. +         (void) ftime(&tb);
  1370. +         return tb.timezone - (tm->tm_isdst ? 60 : 0);
  1371. +     }
  1372. + #endif
  1373. + #ifndef TZMINS_HANDLING
  1374. +     /* Force a compile error if the timezone config is wrong. */
  1375. +     no_tzmins_handling_defined(TZMINS_HANDLING);
  1376. + #endif
  1377. + }
  1378. + /****************************************************************************/
  1379. + char *get_tz_name(tm)
  1380. + struct tm *tm;
  1381. + {
  1382. +     if (tm == 0) {
  1383. +         time_t t;
  1384. +         (void) time(&t);
  1385. +         tm = localtime(&t);
  1386. +     }
  1387. + #ifdef TZNAME_USE_TM_NAME
  1388. + #define TZNAME_HANDLING 1
  1389. +     /*
  1390. +      * This system maintains the timezone name in the (struct tm).
  1391. +      */
  1392. +     return tm->tm_name;
  1393. + #endif
  1394. + #ifdef TZNAME_USE_TM_ZONE
  1395. + #define TZNAME_HANDLING 2
  1396. +     /*
  1397. +      * This system maintains the timezone name in the (struct tm).
  1398. +      */
  1399. +     return tm->tm_zone;
  1400. + #endif
  1401. + #ifdef TZNAME_USE_TZNAME
  1402. + #define TZNAME_HANDLING 3
  1403. +     /*
  1404. +      * This system maintains a global array that contains two timezone
  1405. +      * names, one for when DST is in effect and one for when it is not.
  1406. +      * We simply need to pick the right one.
  1407. +      */
  1408. +     {
  1409. +         extern char *tzname[];
  1410. +         return tzname[tm->tm_isdst];
  1411. +     }
  1412. + #endif
  1413. + #ifdef TZNAME_USE_TIMEZONE
  1414. + #define TZNAME_HANDLING 4
  1415. +     /*
  1416. +      * This system provides a timezone() procedure to get a timezone
  1417. +      * name.  Be careful -- some systems have this procedure but
  1418. +      * depreciate its use, and in some cases it is outright broke.
  1419. +      */
  1420. +     {
  1421. +         extern char *timezone();
  1422. +         return timezone(get_tz_mins(tm), tm->tm_isdst);
  1423. +     }
  1424. + #endif
  1425. + #ifndef TZNAME_HANDLING
  1426. +     /* Force a compile error if the timezone config is wrong. */
  1427. +     no_tzname_handling_defined(TZNAME_HANDLING);
  1428. + #endif
  1429. + }
  1430. + /****************************************************************************/
  1431. + #ifdef _TEST
  1432. + /*
  1433. +  * It would be best to futz around with the TZ setting when running this
  1434. +  * test.  In all cases, the "null" and the "localtime()" results should
  1435. +  * be identical, and the "gmtime()" results should indicate "GMT 0"
  1436. +  * regardless of TZ setting.  Here are a few possible TZ settings you
  1437. +  * can try, and the result you should expect.
  1438. +  *
  1439. +  *    TZ=GMT            always GMT 0
  1440. +  *    TZ=CST6CDT        CST 360 or CDT 300, depending upon time of year
  1441. +  *    TZ=EST5EDT        EST 300 or EDT 240, depending upon time of year
  1442. +  *    TZ=EST5EDT;0,364    always EDT 240
  1443. +  *    TZ=EST5EDT;0,0        always EST 300
  1444. +  *
  1445. +  * Oh...this all assumes your system supports TZ. :-)
  1446. +  */
  1447. + main()
  1448. + {
  1449. +     time_t t;
  1450. +     struct tm *tm;
  1451. +     static char f[] = "using %s tm struct - name=\"%s\" mins_west=\"%d\"\n";
  1452. +     (void) time(&t);
  1453. +     tm = (struct tm *)0;
  1454. +     printf(f, "null", get_tz_name(tm), get_tz_mins(tm));
  1455. +     tm = localtime(&t);
  1456. +     printf(f, "localtime()", get_tz_name(tm), get_tz_mins(tm));
  1457. +     tm = gmtime(&t);
  1458. +     printf(f, "gmtime()", get_tz_name(tm), get_tz_mins(tm));
  1459. +     exit(0);
  1460. + }
  1461. + #endif /*_TEST*/
  1462.  
  1463. Index: lib/getaddrfrm.c
  1464. Prereq: 5.3
  1465. *** ../elm2.4/lib/getaddrfrm.c    Sun May 16 16:55:52 1993
  1466. --- lib/getaddrfrm.c    Tue Aug  3 15:28:49 1993
  1467. ***************
  1468. *** 1,8 ****
  1469.   
  1470. ! static char rcsid[] = "@(#)$Id: getaddrfrm.c,v 5.3 1993/05/16 20:55:52 syd Exp $";
  1471.   
  1472.   /*******************************************************************************
  1473. !  *  The Elm Mail System  -  $Revision: 5.3 $   $State: Exp $
  1474.    *
  1475.    *            Copyright (c) 1988-1992 USENET Community Trust
  1476.    *            Copyright (c) 1986,1987 Dave Taylor
  1477. --- 1,8 ----
  1478.   
  1479. ! static char rcsid[] = "@(#)$Id: getaddrfrm.c,v 5.4 1993/08/03 19:28:39 syd Exp $";
  1480.   
  1481.   /*******************************************************************************
  1482. !  *  The Elm Mail System  -  $Revision: 5.4 $   $State: Exp $
  1483.    *
  1484.    *            Copyright (c) 1988-1992 USENET Community Trust
  1485.    *            Copyright (c) 1986,1987 Dave Taylor
  1486. ***************
  1487. *** 14,19 ****
  1488. --- 14,31 ----
  1489.    *
  1490.    *******************************************************************************
  1491.    * $Log: getaddrfrm.c,v $
  1492. +  * Revision 5.4  1993/08/03  19:28:39  syd
  1493. +  * Elm tries to replace the system toupper() and tolower() on current
  1494. +  * BSD systems, which is unnecessary.  Even worse, the replacements
  1495. +  * collide during linking with routines in isctype.o.  This patch adds
  1496. +  * a Configure test to determine whether replacements are really needed
  1497. +  * (BROKE_CTYPE definition).  The <ctype.h> header file is now included
  1498. +  * globally through hdrs/defs.h and the BROKE_CTYPE patchup is handled
  1499. +  * there.  Inclusion of <ctype.h> was removed from *all* the individual
  1500. +  * files, and the toupper() and tolower() routines in lib/opt_utils.c
  1501. +  * were dropped.
  1502. +  * From: chip@chinacat.unicom.com (Chip Rosenthal)
  1503. +  *
  1504.    * Revision 5.3  1993/05/16  20:55:52  syd
  1505.    * Fix bug where text following "<" within double-quote delimited comment
  1506.    * is taken as an address.
  1507. ***************
  1508. *** 34,40 ****
  1509.   **/
  1510.   
  1511.   #include "headers.h"
  1512. - #include <ctype.h>
  1513.   
  1514.   #ifdef USE_EMBEDDED_ADDRESSES
  1515.   
  1516. --- 46,51 ----
  1517.  
  1518. Index: lib/getarpdate.c
  1519. Prereq: 5.8
  1520. *** ../elm2.4/lib/getarpdate.c    Sat May  8 15:22:46 1993
  1521. --- lib/getarpdate.c    Tue Aug  3 15:20:59 1993
  1522. ***************
  1523. *** 1,7 ****
  1524. ! static char rcsid[] = "@(#)$Id: getarpdate.c,v 5.8 1993/05/08 19:22:46 syd Exp $";
  1525.   
  1526.   /*******************************************************************************
  1527. !  *  The Elm Mail System  -  $Revision: 5.8 $   $State: Exp $
  1528.    *
  1529.    *            Copyright (c) 1988-1992 USENET Community Trust
  1530.    *            Copyright (c) 1986,1987 Dave Taylor
  1531. --- 1,7 ----
  1532. ! static char rcsid[] = "@(#)$Id: getarpdate.c,v 5.9 1993/08/03 19:17:33 syd Exp $";
  1533.   
  1534.   /*******************************************************************************
  1535. !  *  The Elm Mail System  -  $Revision: 5.9 $   $State: Exp $
  1536.    *
  1537.    *            Copyright (c) 1988-1992 USENET Community Trust
  1538.    *            Copyright (c) 1986,1987 Dave Taylor
  1539. ***************
  1540. *** 13,18 ****
  1541. --- 13,27 ----
  1542.    *
  1543.    *******************************************************************************
  1544.    * $Log: getarpdate.c,v $
  1545. +  * Revision 5.9  1993/08/03  19:17:33  syd
  1546. +  * Implement new timezone handling.  New file lib/get_tz.c with new timezone
  1547. +  * routines.  Added new TZMINS_USE_xxxxxx and TZNAME_USE_xxxxxx configuration
  1548. +  * definitions.  Obsoleted TZNAME, ALTCHECK, and TZ_MINUTESWEST configuration
  1549. +  * definitions.  Updated Configure.  Modified lib/getarpdate.c and
  1550. +  * lib/strftime.c to use new timezone routines.
  1551. +  *
  1552. +  * From: chip@chinacat.unicom.com (Chip Rosenthal)
  1553. +  *
  1554.    * Revision 5.8  1993/05/08  19:22:46  syd
  1555.    * On the DEC Alpha, OSF/1 the following change made things happy.
  1556.    * From: dave@opus.csd.uwm.edu (Dave Rasmussen)
  1557. ***************
  1558. *** 49,58 ****
  1559.    *
  1560.    ******************************************************************************/
  1561.   
  1562. - /** 
  1563. - **/
  1564.   #include "headers.h"
  1565.   
  1566.   #ifdef I_TIME
  1567. --- 58,63 ----
  1568. ***************
  1569. *** 61,75 ****
  1570.   #ifdef I_SYSTIME
  1571.   #  include <sys/time.h>
  1572.   #endif
  1573. - #ifdef BSD
  1574. - #  include <sys/timeb.h>
  1575. - #endif
  1576. - #include <ctype.h>
  1577.   
  1578.   #ifndef    _POSIX_SOURCE
  1579.   extern struct tm *localtime();
  1580. - extern struct tm *gmtime();
  1581.   extern time_t      time();
  1582.   #endif
  1583.   
  1584. --- 66,74 ----
  1585. ***************
  1586. *** 79,93 ****
  1587.   static char *arpa_monname[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun",
  1588.             "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", ""};
  1589.   
  1590. ! #ifdef TZNAME
  1591. !   extern char *tzname[];
  1592. ! #else
  1593. !   char *timezone();
  1594. ! #endif
  1595. ! #ifdef _AIX370
  1596. ! #undef ALTCHECK
  1597. ! #endif /* _AIX370 */
  1598.   
  1599.   char *
  1600.   get_arpa_date()
  1601. --- 78,85 ----
  1602.   static char *arpa_monname[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun",
  1603.             "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", ""};
  1604.   
  1605. ! extern int get_tz_mins();
  1606. ! extern char *get_tz_name();
  1607.   
  1608.   char *
  1609.   get_arpa_date()
  1610. ***************
  1611. *** 100,190 ****
  1612.       **/
  1613.   
  1614.       static char buffer[SLEN];    /* static character buffer       */
  1615. !     struct tm *the_time;        /* Time structure, see CTIME(3C) */
  1616. !     time_t       junk;        /* time in seconds....         */
  1617.       long       tzmin;        /* number of minutes off gmt      */
  1618.       char      *tzsign;        /* + or - gmt              */
  1619. ! #if !defined(TZNAME) || defined(_AIX)
  1620. ! # ifndef TZ_MINUTESWEST
  1621. !     struct timeb    loc_time;
  1622. !     junk = time((time_t *) 0);
  1623. !     ftime(&loc_time);
  1624. ! # else /* TZ_MINUTESWEST */
  1625. !     struct  timeval  time_val;        
  1626. !     struct  timezone time_zone;
  1627. !     gettimeofday(&time_val, &time_zone);
  1628. !     junk = time_val.tv_sec;
  1629. ! # endif /* TZ_MINUTESWEST */
  1630. ! #else /* TZNAME */
  1631. ! # ifndef __osf__
  1632. !     extern    time_t    timezone;
  1633. ! # endif /* __osf__ */
  1634. ! # ifdef ALTCHECK
  1635. !     extern    time_t    altzone;
  1636. ! # endif
  1637. !     junk = time((time_t *) 0);    /* this must be here for it to work! */
  1638. ! #endif /* TZNAME */
  1639. !     the_time = localtime(&junk);
  1640. !     if (the_time->tm_year < 100)
  1641. !         the_time->tm_year += 1900;
  1642. ! #if !defined(TZNAME) || defined(_AIX)
  1643. ! # ifdef TZ_MINUTESWEST
  1644. ! #  ifndef AIX
  1645. !     if (the_time->tm_isdst && time_zone.tz_dsttime != DST_NONE)
  1646. !         tzmin = - (time_zone.tz_minuteswest - 60);
  1647. !     else
  1648. ! #  endif /* AIX */
  1649. !         tzmin = - time_zone.tz_minuteswest;
  1650. ! # else /* TZ_MINUTESWEST */
  1651. !     tzmin = the_time->tm_gmtoff / 60;
  1652. ! # endif /* TZ_MINUTESWEST */
  1653. ! #else /* TZNAME */
  1654. ! # ifdef ALTCHECK
  1655. !     if (the_time->tm_isdst)
  1656. !         tzmin = - (altzone / 60);
  1657. !     else
  1658. !         tzmin = - (timezone / 60);
  1659. ! # else /* ALTCHECK */
  1660. !     tzmin = - (timezone / 60);
  1661. ! # endif /* ALTCHECK */
  1662. ! #endif /* TZNAME */
  1663.   
  1664. !     if (tzmin >= 0)
  1665.           tzsign = "+";
  1666. !     else {
  1667.           tzsign = "-";
  1668.           tzmin = -tzmin;
  1669.       }
  1670.       sprintf(buffer, "%s, %d %s %d %02d:%02d:%02d %s%02d%02d (%s)",
  1671. !       arpa_dayname[the_time->tm_wday],
  1672. !       the_time->tm_mday,
  1673. !       arpa_monname[the_time->tm_mon], the_time->tm_year,
  1674. !       the_time->tm_hour, the_time->tm_min, the_time->tm_sec,
  1675. !       tzsign, tzmin / 60, tzmin % 60,
  1676. ! #if !defined(TZNAME) || defined(_AIX)
  1677. ! #ifdef TZ_MINUTESWEST
  1678. ! # ifdef GOULD_NP1
  1679. !       the_time->tm_zone);
  1680. ! # else
  1681. ! #  ifndef _AIX
  1682. !       timezone(time_zone.tz_minuteswest, the_time->tm_isdst));
  1683. ! #  else /* AIX has tzname */
  1684. !       tzname[the_time->tm_isdst]);      
  1685. ! #  endif      
  1686. ! # endif
  1687. ! #else
  1688. !       timezone(loc_time.timezone, the_time->tm_isdst));
  1689. ! #endif
  1690. ! #else
  1691. !       tzname[the_time->tm_isdst]);
  1692. ! #endif
  1693.       
  1694. !     return( (char *) buffer);
  1695.   }
  1696. --- 92,118 ----
  1697.       **/
  1698.   
  1699.       static char buffer[SLEN];    /* static character buffer       */
  1700. !     time_t       curr_time;        /* time in seconds....         */
  1701. !     struct tm *curr_tm;        /* Time structure, see CTIME(3C) */
  1702.       long       tzmin;        /* number of minutes off gmt      */
  1703.       char      *tzsign;        /* + or - gmt              */
  1704. !     int      year;            /* current year - with century     */
  1705.   
  1706. !     (void) time(&curr_time);
  1707. !     curr_tm = localtime(&curr_time);
  1708. !     if ((year = curr_tm->tm_year) < 100)
  1709. !         year += 1900;
  1710. !     if ((tzmin = -get_tz_mins(curr_tm)) >= 0) {
  1711.           tzsign = "+";
  1712. !     } else {
  1713.           tzsign = "-";
  1714.           tzmin = -tzmin;
  1715.       }
  1716.       sprintf(buffer, "%s, %d %s %d %02d:%02d:%02d %s%02d%02d (%s)",
  1717. !       arpa_dayname[curr_tm->tm_wday],
  1718. !       curr_tm->tm_mday, arpa_monname[curr_tm->tm_mon], year,
  1719. !       curr_tm->tm_hour, curr_tm->tm_min, curr_tm->tm_sec,
  1720. !       tzsign, tzmin / 60, tzmin % 60, get_tz_name(curr_tm));
  1721.       
  1722. !     return buffer;
  1723.   }
  1724.  
  1725. Index: lib/getword.c
  1726. Prereq: 5.1
  1727. *** ../elm2.4/lib/getword.c    Mon Jan 18 23:46:52 1993
  1728. --- lib/getword.c    Tue Aug  3 15:28:50 1993
  1729. ***************
  1730. *** 1,8 ****
  1731.   
  1732. ! static char rcsid[] = "@(#)$Id: getword.c,v 5.1 1993/01/19 04:46:21 syd Exp $";
  1733.   
  1734.   /*******************************************************************************
  1735. !  *  The Elm Mail System  -  $Revision: 5.1 $   $State: Exp $
  1736.    *
  1737.    *             Copyright (c) 1993 USENET Community Trust
  1738.    *******************************************************************************
  1739. --- 1,8 ----
  1740.   
  1741. ! static char rcsid[] = "@(#)$Id: getword.c,v 5.2 1993/08/03 19:28:39 syd Exp $";
  1742.   
  1743.   /*******************************************************************************
  1744. !  *  The Elm Mail System  -  $Revision: 5.2 $   $State: Exp $
  1745.    *
  1746.    *             Copyright (c) 1993 USENET Community Trust
  1747.    *******************************************************************************
  1748. ***************
  1749. *** 13,18 ****
  1750. --- 13,30 ----
  1751.    *
  1752.    *******************************************************************************
  1753.    * $Log: getword.c,v $
  1754. +  * Revision 5.2  1993/08/03  19:28:39  syd
  1755. +  * Elm tries to replace the system toupper() and tolower() on current
  1756. +  * BSD systems, which is unnecessary.  Even worse, the replacements
  1757. +  * collide during linking with routines in isctype.o.  This patch adds
  1758. +  * a Configure test to determine whether replacements are really needed
  1759. +  * (BROKE_CTYPE definition).  The <ctype.h> header file is now included
  1760. +  * globally through hdrs/defs.h and the BROKE_CTYPE patchup is handled
  1761. +  * there.  Inclusion of <ctype.h> was removed from *all* the individual
  1762. +  * files, and the toupper() and tolower() routines in lib/opt_utils.c
  1763. +  * were dropped.
  1764. +  * From: chip@chinacat.unicom.com (Chip Rosenthal)
  1765. +  *
  1766.    * Revision 5.1  1993/01/19  04:46:21  syd
  1767.    * Initial Checkin
  1768.    *
  1769. ***************
  1770. *** 20,26 ****
  1771.    ******************************************************************************/
  1772.   
  1773.   #include <stdio.h>
  1774. - #include <ctype.h>
  1775.   #include "defs.h"
  1776.   
  1777.   int get_word(buffer, start, word, wordlen)
  1778. --- 32,37 ----
  1779.  
  1780. Index: lib/header_cmp.c
  1781. Prereq: 5.2
  1782. *** ../elm2.4/lib/header_cmp.c    Sat Nov  7 15:59:52 1992
  1783. --- lib/header_cmp.c    Tue Aug  3 15:28:50 1993
  1784. ***************
  1785. *** 1,7 ****
  1786. ! static char rcsid[] = "@(#)$Id: header_cmp.c,v 5.2 1992/11/07 20:59:49 syd Exp $";
  1787.   
  1788.   /*******************************************************************************
  1789. !  *  The Elm Mail System  -  $Revision: 5.2 $   $State: Exp $
  1790.    *
  1791.    *            Copyright (c) 1988-1992 USENET Community Trust
  1792.    *            Copyright (c) 1986,1987 Dave Taylor
  1793. --- 1,7 ----
  1794. ! static char rcsid[] = "@(#)$Id: header_cmp.c,v 5.3 1993/08/03 19:28:39 syd Exp $";
  1795.   
  1796.   /*******************************************************************************
  1797. !  *  The Elm Mail System  -  $Revision: 5.3 $   $State: Exp $
  1798.    *
  1799.    *            Copyright (c) 1988-1992 USENET Community Trust
  1800.    *            Copyright (c) 1986,1987 Dave Taylor
  1801. ***************
  1802. *** 13,18 ****
  1803. --- 13,30 ----
  1804.    *
  1805.    *******************************************************************************
  1806.    * $Log: header_cmp.c,v $
  1807. +  * Revision 5.3  1993/08/03  19:28:39  syd
  1808. +  * Elm tries to replace the system toupper() and tolower() on current
  1809. +  * BSD systems, which is unnecessary.  Even worse, the replacements
  1810. +  * collide during linking with routines in isctype.o.  This patch adds
  1811. +  * a Configure test to determine whether replacements are really needed
  1812. +  * (BROKE_CTYPE definition).  The <ctype.h> header file is now included
  1813. +  * globally through hdrs/defs.h and the BROKE_CTYPE patchup is handled
  1814. +  * there.  Inclusion of <ctype.h> was removed from *all* the individual
  1815. +  * files, and the toupper() and tolower() routines in lib/opt_utils.c
  1816. +  * were dropped.
  1817. +  * From: chip@chinacat.unicom.com (Chip Rosenthal)
  1818. +  *
  1819.    * Revision 5.2  1992/11/07  20:59:49  syd
  1820.    * fix typo
  1821.    *
  1822. ***************
  1823. *** 32,42 ****
  1824.   **/
  1825.   
  1826.   #include "headers.h"
  1827. - #include <ctype.h>
  1828. - #ifdef BSD
  1829. - #undef tolower
  1830. - #endif
  1831.   
  1832.   
  1833.   char *
  1834. --- 44,49 ----
  1835.  
  1836. Index: lib/istrcmp.c
  1837. Prereq: 5.1
  1838. *** ../elm2.4/lib/istrcmp.c    Sat Oct  3 18:42:24 1992
  1839. --- lib/istrcmp.c    Tue Aug  3 15:28:51 1993
  1840. ***************
  1841. *** 1,7 ****
  1842. ! static char rcsid[] = "@(#)$Id: istrcmp.c,v 5.1 1992/10/03 22:41:36 syd Exp $";
  1843.   
  1844.   /*******************************************************************************
  1845. !  *  The Elm Mail System  -  $Revision: 5.1 $   $State: Exp $
  1846.    *
  1847.    *            Copyright (c) 1988-1992 USENET Community Trust
  1848.    *            Copyright (c) 1986,1987 Dave Taylor
  1849. --- 1,7 ----
  1850. ! static char rcsid[] = "@(#)$Id: istrcmp.c,v 5.2 1993/08/03 19:28:39 syd Exp $";
  1851.   
  1852.   /*******************************************************************************
  1853. !  *  The Elm Mail System  -  $Revision: 5.2 $   $State: Exp $
  1854.    *
  1855.    *            Copyright (c) 1988-1992 USENET Community Trust
  1856.    *            Copyright (c) 1986,1987 Dave Taylor
  1857. ***************
  1858. *** 13,18 ****
  1859. --- 13,30 ----
  1860.    *
  1861.    *******************************************************************************
  1862.    * $Log: istrcmp.c,v $
  1863. +  * Revision 5.2  1993/08/03  19:28:39  syd
  1864. +  * Elm tries to replace the system toupper() and tolower() on current
  1865. +  * BSD systems, which is unnecessary.  Even worse, the replacements
  1866. +  * collide during linking with routines in isctype.o.  This patch adds
  1867. +  * a Configure test to determine whether replacements are really needed
  1868. +  * (BROKE_CTYPE definition).  The <ctype.h> header file is now included
  1869. +  * globally through hdrs/defs.h and the BROKE_CTYPE patchup is handled
  1870. +  * there.  Inclusion of <ctype.h> was removed from *all* the individual
  1871. +  * files, and the toupper() and tolower() routines in lib/opt_utils.c
  1872. +  * were dropped.
  1873. +  * From: chip@chinacat.unicom.com (Chip Rosenthal)
  1874. +  *
  1875.    * Revision 5.1  1992/10/03  22:41:36  syd
  1876.    * Initial checkin as of 2.4 Release at PL0
  1877.    *
  1878. ***************
  1879. *** 24,35 ****
  1880.   **/
  1881.   
  1882.   #include "headers.h"
  1883. - #include <ctype.h>
  1884. - #ifdef BSD
  1885. - #undef tolower
  1886. - #endif
  1887.   
  1888.   int
  1889.   istrcmp(s1,s2)
  1890. --- 36,41 ----
  1891. ***************
  1892. *** 38,45 ****
  1893.       /* case insensitive comparison */
  1894.       register int d;
  1895.       for (;;) {
  1896. !       d = ( isupper(*s1) ? tolower(*s1) : *s1 )
  1897. !           - ( isupper(*s2) ? tolower(*s2) : *s2 ) ;
  1898.         if ( d != 0 || *s1 == '\0' || *s2 == '\0' )
  1899.           return d;
  1900.         ++s1;
  1901. --- 44,50 ----
  1902.       /* case insensitive comparison */
  1903.       register int d;
  1904.       for (;;) {
  1905. !       d = (tolower(*s1) - tolower(*s2));
  1906.         if ( d != 0 || *s1 == '\0' || *s2 == '\0' )
  1907.           return d;
  1908.         ++s1;
  1909.  
  1910. Index: lib/ldstate.c
  1911. Prereq: 5.5
  1912. *** ../elm2.4/lib/ldstate.c    Wed Feb  3 10:26:31 1993
  1913. --- lib/ldstate.c    Sun Aug 22 22:46:53 1993
  1914. ***************
  1915. *** 1,8 ****
  1916.   
  1917. ! static char rcsid[] = "@(#)$Id: ldstate.c,v 5.5 1993/02/03 15:26:13 syd Exp $";
  1918.   
  1919.   /*******************************************************************************
  1920. !  *  The Elm Mail System  -  $Revision: 5.5 $   $State: Exp $
  1921.    *
  1922.    *            Copyright (c) 1992 USENET Community Trust
  1923.    *******************************************************************************
  1924. --- 1,8 ----
  1925.   
  1926. ! static char rcsid[] = "@(#)$Id: ldstate.c,v 5.6 1993/08/23 02:46:51 syd Exp $";
  1927.   
  1928.   /*******************************************************************************
  1929. !  *  The Elm Mail System  -  $Revision: 5.6 $   $State: Exp $
  1930.    *
  1931.    *            Copyright (c) 1992 USENET Community Trust
  1932.    *******************************************************************************
  1933. ***************
  1934. *** 13,18 ****
  1935. --- 13,22 ----
  1936.    *
  1937.    *******************************************************************************
  1938.    * $Log: ldstate.c,v $
  1939. +  * Revision 5.6  1993/08/23  02:46:51  syd
  1940. +  * Test ANSI_C, not __STDC__ (which is not set on e.g. AIX).
  1941. +  * From: decwrl!uunet.UU.NET!fin!chip (Chip Salzenberg)
  1942. +  *
  1943.    * Revision 5.5  1993/02/03  15:26:13  syd
  1944.    * protect atol in ifndef __STDC__ as some make it a macro, and its in stdlib.h
  1945.    *
  1946. ***************
  1947. *** 57,64 ****
  1948.    * the (struct folder_state) record.
  1949.    */
  1950.   
  1951. ! #ifndef __STDC__ /* avoid problemswith systems that declare atol as a macro */
  1952. !     extern long atol();
  1953.   #endif
  1954.   
  1955.   static char *elm_fgetline(buf, buflen, fp)
  1956. --- 61,68 ----
  1957.    * the (struct folder_state) record.
  1958.    */
  1959.   
  1960. ! #if !ANSI_C  /* avoid problems with systems that declare atol as a macro */
  1961. ! extern long atol();
  1962.   #endif
  1963.   
  1964.   static char *elm_fgetline(buf, buflen, fp)
  1965.  
  1966. Index: lib/len_next.c
  1967. Prereq: 5.4
  1968. *** ../elm2.4/lib/len_next.c    Sun Apr 11 21:27:30 1993
  1969. --- lib/len_next.c    Tue Aug  3 15:28:51 1993
  1970. ***************
  1971. *** 1,8 ****
  1972.   
  1973. ! static char rcsid[] = "@(#)$Id: len_next.c,v 5.4 1993/04/12 01:27:30 syd Exp $";
  1974.   
  1975.   /*******************************************************************************
  1976. !  *  The Elm Mail System  -  $Revision: 5.4 $   $State: Exp $
  1977.    *
  1978.    *             Copyright (c) 1992 USENET Community Trust
  1979.    *******************************************************************************
  1980. --- 1,8 ----
  1981.   
  1982. ! static char rcsid[] = "@(#)$Id: len_next.c,v 5.5 1993/08/03 19:28:39 syd Exp $";
  1983.   
  1984.   /*******************************************************************************
  1985. !  *  The Elm Mail System  -  $Revision: 5.5 $   $State: Exp $
  1986.    *
  1987.    *             Copyright (c) 1992 USENET Community Trust
  1988.    *******************************************************************************
  1989. ***************
  1990. *** 13,18 ****
  1991. --- 13,30 ----
  1992.    *
  1993.    *******************************************************************************
  1994.    * $Log: len_next.c,v $
  1995. +  * Revision 5.5  1993/08/03  19:28:39  syd
  1996. +  * Elm tries to replace the system toupper() and tolower() on current
  1997. +  * BSD systems, which is unnecessary.  Even worse, the replacements
  1998. +  * collide during linking with routines in isctype.o.  This patch adds
  1999. +  * a Configure test to determine whether replacements are really needed
  2000. +  * (BROKE_CTYPE definition).  The <ctype.h> header file is now included
  2001. +  * globally through hdrs/defs.h and the BROKE_CTYPE patchup is handled
  2002. +  * there.  Inclusion of <ctype.h> was removed from *all* the individual
  2003. +  * files, and the toupper() and tolower() routines in lib/opt_utils.c
  2004. +  * were dropped.
  2005. +  * From: chip@chinacat.unicom.com (Chip Rosenthal)
  2006. +  *
  2007.    * Revision 5.4  1993/04/12  01:27:30  syd
  2008.    * len_next_part() was botching quote-delimited strings.
  2009.    * From: chip@chinacat.unicom.com (Chip Rosenthal)
  2010. ***************
  2011. *** 54,61 ****
  2012.   
  2013.   **/
  2014.   
  2015. - #include <ctype.h>
  2016.   
  2017.   int
  2018.   len_next_part(str)
  2019. --- 66,71 ----
  2020.  
  2021. Index: lib/mail_gets.c
  2022. Prereq: 5.2
  2023. *** ../elm2.4/lib/mail_gets.c    Sun Apr 11 21:13:30 1993
  2024. --- lib/mail_gets.c    Tue Aug  3 15:28:52 1993
  2025. ***************
  2026. *** 1,8 ****
  2027.   
  2028. ! static char rcsid[] = "@(#)$Id: mail_gets.c,v 5.2 1993/04/12 01:13:30 syd Exp $";
  2029.   
  2030.   /*******************************************************************************
  2031. !  *  The Elm Mail System  -  $Revision: 5.2 $   $State: Exp $
  2032.    *
  2033.    *             Copyright (c) 1992 USENET Community Trust
  2034.    *******************************************************************************
  2035. --- 1,8 ----
  2036.   
  2037. ! static char rcsid[] = "@(#)$Id: mail_gets.c,v 5.4 1993/08/03 19:28:39 syd Exp $";
  2038.   
  2039.   /*******************************************************************************
  2040. !  *  The Elm Mail System  -  $Revision: 5.4 $   $State: Exp $
  2041.    *
  2042.    *             Copyright (c) 1992 USENET Community Trust
  2043.    *******************************************************************************
  2044. ***************
  2045. *** 13,18 ****
  2046. --- 13,39 ----
  2047.    *
  2048.    *******************************************************************************
  2049.    * $Log: mail_gets.c,v $
  2050. +  * Revision 5.4  1993/08/03  19:28:39  syd
  2051. +  * Elm tries to replace the system toupper() and tolower() on current
  2052. +  * BSD systems, which is unnecessary.  Even worse, the replacements
  2053. +  * collide during linking with routines in isctype.o.  This patch adds
  2054. +  * a Configure test to determine whether replacements are really needed
  2055. +  * (BROKE_CTYPE definition).  The <ctype.h> header file is now included
  2056. +  * globally through hdrs/defs.h and the BROKE_CTYPE patchup is handled
  2057. +  * there.  Inclusion of <ctype.h> was removed from *all* the individual
  2058. +  * files, and the toupper() and tolower() routines in lib/opt_utils.c
  2059. +  * were dropped.
  2060. +  * From: chip@chinacat.unicom.com (Chip Rosenthal)
  2061. +  *
  2062. +  * Revision 5.3  1993/08/03  19:05:33  syd
  2063. +  * When STDC is used on Convex the feof() function is defined as
  2064. +  * a true library routine in the header files and moreover the
  2065. +  * library routine also leaks royally. It returns always 1!!
  2066. +  * So we have to use a macro. Convex naturally does not provide
  2067. +  * you with one though if you are using a STDC compiler. So we
  2068. +  * have to include one.
  2069. +  * From: Jukka Ukkonen <ukkonen@csc.fi>
  2070. +  *
  2071.    * Revision 5.2  1993/04/12  01:13:30  syd
  2072.    * In some cases, with certain editors, the user can create an
  2073.    * aliases.text file in which the last line is terminated with an EOF but
  2074. ***************
  2075. *** 33,40 ****
  2076.   **/
  2077.   
  2078.   #include <stdio.h>
  2079. ! #include <ctype.h>
  2080.   
  2081.   int
  2082.   mail_gets(buffer, size, mailfile)
  2083. --- 54,60 ----
  2084.   **/
  2085.   
  2086.   #include <stdio.h>
  2087. ! #include "defs.h"
  2088.   
  2089.   int
  2090.   mail_gets(buffer, size, mailfile)
  2091. ***************
  2092. *** 46,51 ****
  2093. --- 66,72 ----
  2094.       register char *c = buffer;
  2095.   
  2096.       size--; /* allow room for zero terminator on end, just in case */
  2097.       while (!feof(mailfile) && !ferror(mailfile) && line_bytes < size) {
  2098.         ch = getc(mailfile); /* Macro, faster than  fgetc() ! */
  2099.   
  2100.  
  2101. Index: lib/mcprt.c
  2102. *** ../elm2.4/lib/mcprt.c    Sat Oct  3 18:42:25 1992
  2103. --- lib/mcprt.c    Sun Aug 22 22:49:36 1993
  2104. ***************
  2105. *** 1,4 ****
  2106. --- 1,6 ----
  2107.   
  2108. + static char rcsid[] = "@(#)$Id: mcprt.c,v 5.5 1993/08/23 02:49:35 syd Exp $";
  2109.   /***********************************************************
  2110.   Copyright 1990, by Alfalfa Software Incorporated, Cambridge, Massachusetts.
  2111.   
  2112. ***************
  2113. *** 35,41 ****
  2114.   
  2115.   01/18/91   3 hamilton    #if not rescanned
  2116.   01/12/91   1 schulert    conditionally use prototypes
  2117. !             rework to use either varargs or stdargs
  2118.   11/03/90   2 hamilton    Alphalpha->Alfalfa & OmegaMail->Poste
  2119.   08/10/90   1 nazgul    printf, sprintf and fprintf
  2120.   */
  2121. --- 37,43 ----
  2122.   
  2123.   01/18/91   3 hamilton    #if not rescanned
  2124.   01/12/91   1 schulert    conditionally use prototypes
  2125. !             rework to use either varargs or stdarg
  2126.   11/03/90   2 hamilton    Alphalpha->Alfalfa & OmegaMail->Poste
  2127.   08/10/90   1 nazgul    printf, sprintf and fprintf
  2128.   */
  2129. ***************
  2130. *** 47,55 ****
  2131. --- 49,61 ----
  2132.   #include "mcprt.h"
  2133.   #include "mcprtlib.h"
  2134.   
  2135. + #ifdef    I_STDARG
  2136. + int    MCprintf(char *fmt, ...)
  2137. + #else
  2138.   int    MCprintf(fmt, va_alist)
  2139.   char *fmt;
  2140.   va_dcl
  2141. + #endif
  2142.   {
  2143.       MCRockT    *rock;
  2144.       int        len, i;
  2145. ***************
  2146. *** 65,74 ****
  2147. --- 71,84 ----
  2148.       return len;
  2149.   }
  2150.   
  2151. + #ifdef    I_STDARG
  2152. + int    MCfprintf(FILE *fptr, char *fmt, ...)
  2153. + #else
  2154.   int    MCfprintf(fptr, fmt, va_alist)
  2155.   FILE *fptr;
  2156.   char *fmt;
  2157.   va_dcl
  2158. + #endif
  2159.   {
  2160.       MCRockT    *rock;
  2161.       int        len, i;
  2162. ***************
  2163. *** 84,93 ****
  2164. --- 94,107 ----
  2165.       return len;
  2166.   }
  2167.   
  2168. + #ifdef    I_STDARG
  2169. + int    MCsprintf(char *cptr, char *fmt, ...)
  2170. + #else
  2171.   int    MCsprintf(cptr, fmt, va_alist)
  2172.   char *cptr;
  2173.   char *fmt;
  2174.   va_dcl
  2175. + #endif
  2176.   {
  2177.       MCRockT    *rock;
  2178.       int        len, i;
  2179.  
  2180. Index: lib/mcprtlib.c
  2181. *** ../elm2.4/lib/mcprtlib.c    Sat Oct  3 18:42:26 1992
  2182. --- lib/mcprtlib.c    Sun Aug 22 22:54:32 1993
  2183. ***************
  2184. *** 1,4 ****
  2185. --- 1,6 ----
  2186.   
  2187. + static char rcsid[] = "@(#)$Id: mcprtlib.c,v 5.5 1993/08/23 02:54:31 syd Exp $";
  2188.   /***********************************************************
  2189.   Copyright 1990, by Alfalfa Software Incorporated, Cambridge, Massachusetts.
  2190.   
  2191. ***************
  2192. *** 47,53 ****
  2193.   #define    CATGETS
  2194.   
  2195.   #include <stdio.h>
  2196. - #include <ctype.h>
  2197.   #include "defs.h"
  2198.   
  2199.   #include "mcprtlib.h"
  2200. --- 49,54 ----
  2201. ***************
  2202. *** 292,297 ****
  2203. --- 293,302 ----
  2204.        * Set the correct types and figure out how many data segments we are going
  2205.        * to have.
  2206.        */
  2207. +     /* Initialize typeList */
  2208. +     for (i = 0; i < typeCnt; i++)
  2209. +       typeList[i].type = 0;
  2210.       for (replyCnt = i = 0; i < argCnt; ++i) {
  2211.       if (argList[i].type) {
  2212.           pos = argList[i].pos-1;
  2213. ***************
  2214. *** 580,586 ****
  2215.       if (rock->typeList) free((char *) rock->typeList);
  2216.       
  2217.       if (rock->replyList) {
  2218. !     for (i = 0; i < rock->argCnt; ++i) {
  2219.           if ((rock->replyList[i].argType & MCFree) && rock->replyList[i].data)
  2220.             free(rock->replyList[i].data);
  2221.       }
  2222. --- 585,591 ----
  2223.       if (rock->typeList) free((char *) rock->typeList);
  2224.       
  2225.       if (rock->replyList) {
  2226. !     for (i = 0; i < rock->replyCnt; ++i) {
  2227.           if ((rock->replyList[i].argType & MCFree) && rock->replyList[i].data)
  2228.             free(rock->replyList[i].data);
  2229.       }
  2230.  
  2231. Index: lib/mk_aliases.c
  2232. Prereq: 5.12
  2233. *** ../elm2.4/lib/mk_aliases.c    Sat May  8 16:25:34 1993
  2234. --- lib/mk_aliases.c    Tue Aug  3 15:28:53 1993
  2235. ***************
  2236. *** 1,8 ****
  2237.   
  2238. ! static char rcsid[] = "@(#)$Id: mk_aliases.c,v 5.12 1993/05/08 20:25:33 syd Exp $";
  2239.   
  2240.   /*******************************************************************************
  2241. !  *  The Elm Mail System  -  $Revision: 5.12 $   $State: Exp $
  2242.    *
  2243.    *            Copyright (c) 1988-1992 USENET Community Trust
  2244.    *            Copyright (c) 1986,1987 Dave Taylor
  2245. --- 1,8 ----
  2246.   
  2247. ! static char rcsid[] = "@(#)$Id: mk_aliases.c,v 5.15 1993/08/03 19:28:39 syd Exp $";
  2248.   
  2249.   /*******************************************************************************
  2250. !  *  The Elm Mail System  -  $Revision: 5.15 $   $State: Exp $
  2251.    *
  2252.    *            Copyright (c) 1988-1992 USENET Community Trust
  2253.    *            Copyright (c) 1986,1987 Dave Taylor
  2254. ***************
  2255. *** 14,19 ****
  2256. --- 14,40 ----
  2257.    *
  2258.    *******************************************************************************
  2259.    * $Log: mk_aliases.c,v $
  2260. +  * Revision 5.15  1993/08/03  19:28:39  syd
  2261. +  * Elm tries to replace the system toupper() and tolower() on current
  2262. +  * BSD systems, which is unnecessary.  Even worse, the replacements
  2263. +  * collide during linking with routines in isctype.o.  This patch adds
  2264. +  * a Configure test to determine whether replacements are really needed
  2265. +  * (BROKE_CTYPE definition).  The <ctype.h> header file is now included
  2266. +  * globally through hdrs/defs.h and the BROKE_CTYPE patchup is handled
  2267. +  * there.  Inclusion of <ctype.h> was removed from *all* the individual
  2268. +  * files, and the toupper() and tolower() routines in lib/opt_utils.c
  2269. +  * were dropped.
  2270. +  * From: chip@chinacat.unicom.com (Chip Rosenthal)
  2271. +  *
  2272. +  * Revision 5.14  1993/07/20  02:59:53  syd
  2273. +  * Support aliases both on 64 bit and 32 bit machines at the same time.
  2274. +  * From: Dan Mosedale <mosedale@genome.stanford.edu>
  2275. +  *
  2276. +  * Revision 5.13  1993/07/20  01:45:56  syd
  2277. +  * When resyncing aliases from elm, and there was aliases to delete,
  2278. +  * the alias.pag file could be corrupted since file_offset wasn't set to zero.
  2279. +  * From: Jan.Djarv@sa.erisoft.se (Jan Djarv)
  2280. +  *
  2281.    * Revision 5.12  1993/05/08  20:25:33  syd
  2282.    * Add sleepmsg to control transient message delays
  2283.    * From: Syd
  2284. ***************
  2285. *** 110,122 ****
  2286.   
  2287.   #include "headers.h"
  2288.   #include "s_newalias.h"
  2289. - #include <ctype.h>
  2290.   #include "ndbz.h"
  2291.   
  2292.   #ifdef BSD
  2293.   #  include <sys/file.h>
  2294. - #  undef tolower
  2295. - #  undef toupper
  2296.   #endif
  2297.   
  2298.   #define group(string)        (index(string,',') != NULL)
  2299. --- 131,140 ----
  2300. ***************
  2301. *** 278,287 ****
  2302.   int
  2303.   add_to_hash_table(word, offset)
  2304.   char *word;
  2305. ! long  offset;
  2306.   {
  2307.       datum    key, value, ovalue;
  2308. !     long    off;
  2309.       
  2310.       key.dptr = word;
  2311.       key.dsize = strlen(word);
  2312. --- 296,305 ----
  2313.   int
  2314.   add_to_hash_table(word, offset)
  2315.   char *word;
  2316. ! int32  offset;
  2317.   {
  2318.       datum    key, value, ovalue;
  2319. !     int32    off;
  2320.       
  2321.       key.dptr = word;
  2322.       key.dsize = strlen(word);
  2323. ***************
  2324. *** 320,326 ****
  2325.   FILE *data;
  2326.   register char *aliases, *lastn, *firstn, *comment, *addresses;
  2327.   {
  2328. !     struct alias_rec    alias;
  2329.       register char    *s;
  2330.   /*
  2331.    *    crack the information into an alias_rec structure, then add the entry
  2332. --- 338,344 ----
  2333.   FILE *data;
  2334.   register char *aliases, *lastn, *firstn, *comment, *addresses;
  2335.   {
  2336. !     struct alias_disk_rec    alias;
  2337.       register char    *s;
  2338.   /*
  2339.    *    crack the information into an alias_rec structure, then add the entry
  2340. ***************
  2341. *** 357,363 ****
  2342.        *  Only add an entry if we could add it to the hash table.
  2343.        *  (no errors or duplicates)
  2344.        */
  2345. !         if (add_to_hash_table(aliases, file_offset+sizeof(alias)) == 0) {
  2346.               file_offset += alias.length + sizeof(alias);
  2347.           /*
  2348.            *  Write the entry to the data file, followed by its data
  2349. --- 375,382 ----
  2350.        *  Only add an entry if we could add it to the hash table.
  2351.        *  (no errors or duplicates)
  2352.        */
  2353. !         if (add_to_hash_table(aliases, (int32)(file_offset+sizeof(alias)))
  2354. !         == 0) {
  2355.               file_offset += alias.length + sizeof(alias);
  2356.           /*
  2357.            *  Write the entry to the data file, followed by its data
  2358. ***************
  2359. *** 714,719 ****
  2360. --- 733,739 ----
  2361.       buff_loaded = 0;     /* file buffer empty right now! */
  2362.       al_count = 0;
  2363.       err_flag = 0;
  2364. +     file_offset = 0;
  2365.   
  2366.       while (get_alias(in, fromelm) != -1) {
  2367.           put_alias(data);
  2368.  
  2369. Index: lib/msgcat.c
  2370. *** ../elm2.4/lib/msgcat.c    Sun Apr 11 23:22:31 1993
  2371. --- lib/msgcat.c    Wed Jun  9 23:12:20 1993
  2372. ***************
  2373. *** 1,3 ****
  2374. --- 1,6 ----
  2375. + static char rcsid[] = "@(#)$Id: msgcat.c,v 5.2 1993/06/10 03:12:10 syd Exp $";
  2376.   /* -*- c++ -*- */
  2377.   
  2378.   /***********************************************************
  2379.  
  2380. Index: lib/ndbz.c
  2381. Prereq: 5.6
  2382. *** ../elm2.4/lib/ndbz.c    Sun Apr 11 23:22:31 1993
  2383. --- lib/ndbz.c    Sun Aug 22 22:46:55 1993
  2384. ***************
  2385. *** 1,7 ****
  2386. ! static char rcsid[] = "@(#)$Id: ndbz.c,v 5.6 1993/02/08 00:18:11 syd Exp $";
  2387.   
  2388.   /*******************************************************************************
  2389. !  *  The Elm Mail System  -  $Revision: 5.6 $   $State: Exp $
  2390.    *
  2391.    *            Copyright (c) 1988-1992 USENET Community Trust
  2392.    *            Copyright (c) 1986,1987 Dave Taylor
  2393. --- 1,7 ----
  2394. ! static char rcsid[] = "@(#)$Id: ndbz.c,v 5.11 1993/08/23 02:46:51 syd Exp $";
  2395.   
  2396.   /*******************************************************************************
  2397. !  *  The Elm Mail System  -  $Revision: 5.11 $   $State: Exp $
  2398.    *
  2399.    *            Copyright (c) 1988-1992 USENET Community Trust
  2400.    *            Copyright (c) 1986,1987 Dave Taylor
  2401. ***************
  2402. *** 13,18 ****
  2403. --- 13,47 ----
  2404.    *
  2405.    *******************************************************************************
  2406.    * $Log: ndbz.c,v $
  2407. +  * Revision 5.11  1993/08/23  02:46:51  syd
  2408. +  * Test ANSI_C, not __STDC__ (which is not set on e.g. AIX).
  2409. +  * From: decwrl!uunet.UU.NET!fin!chip (Chip Salzenberg)
  2410. +  *
  2411. +  * Revision 5.10  1993/08/03  19:28:39  syd
  2412. +  * Elm tries to replace the system toupper() and tolower() on current
  2413. +  * BSD systems, which is unnecessary.  Even worse, the replacements
  2414. +  * collide during linking with routines in isctype.o.  This patch adds
  2415. +  * a Configure test to determine whether replacements are really needed
  2416. +  * (BROKE_CTYPE definition).  The <ctype.h> header file is now included
  2417. +  * globally through hdrs/defs.h and the BROKE_CTYPE patchup is handled
  2418. +  * there.  Inclusion of <ctype.h> was removed from *all* the individual
  2419. +  * files, and the toupper() and tolower() routines in lib/opt_utils.c
  2420. +  * were dropped.
  2421. +  * From: chip@chinacat.unicom.com (Chip Rosenthal)
  2422. +  *
  2423. +  * Revision 5.9  1993/08/03  19:22:01  syd
  2424. +  * Add proper casts to free() calls to suppress warnings.
  2425. +  * Properly cast return types.
  2426. +  * From: chip@chinacat.unicom.com (Chip Rosenthal)
  2427. +  *
  2428. +  * Revision 5.8  1993/07/20  02:59:53  syd
  2429. +  * Support aliases both on 64 bit and 32 bit machines at the same time.
  2430. +  * From: Dan Mosedale <mosedale@genome.stanford.edu>
  2431. +  *
  2432. +  * Revision 5.7  1993/06/09  23:41:34  syd
  2433. +  * Add frees of db structure on failed dbz_open
  2434. +  * From: Syd
  2435. +  *
  2436.    * Revision 5.6  1993/02/08  00:18:11  syd
  2437.    * fix taghere to be || instead of | and paren to make
  2438.    * it catch duplicates again, as per testing.
  2439. ***************
  2440. *** 74,80 ****
  2441.   */
  2442.   
  2443.   #include "headers.h"
  2444. - #include <ctype.h>
  2445.   #include <errno.h>
  2446.   #ifndef ANSI_C
  2447.   extern int errno;
  2448. --- 103,108 ----
  2449. ***************
  2450. *** 194,200 ****
  2451.   #endif
  2452.   
  2453.   static int getconf();
  2454. ! static long getno();
  2455.   static int putconf();
  2456.   static void mybytemap();
  2457.   static of_t bytemap();
  2458. --- 222,228 ----
  2459.   #endif
  2460.   
  2461.   static int getconf();
  2462. ! static int32 getno();
  2463.   static int putconf();
  2464.   static void mybytemap();
  2465.   static of_t bytemap();
  2466. ***************
  2467. *** 246,252 ****
  2468.   #define    MAPOUT(o)    ((db->dbz_bytesame) ? (o) : bytemap((o), db->dbz_mybmap, db->dbz_conf.bytemap))
  2469.   
  2470.   /* externals used */
  2471. ! #ifndef __STDC__ /* avoid problemswith systems that declare atol as a macro */
  2472.   extern long atol();
  2473.   #endif
  2474.   
  2475. --- 274,280 ----
  2476.   #define    MAPOUT(o)    ((db->dbz_bytesame) ? (o) : bytemap((o), db->dbz_mybmap, db->dbz_conf.bytemap))
  2477.   
  2478.   /* externals used */
  2479. ! #if !ANSI_C  /* avoid problems with systems that declare atol as a macro */
  2480.   extern long atol();
  2481.   #endif
  2482.   
  2483. ***************
  2484. *** 282,293 ****
  2485.   
  2486.       if (size != 0 && size < 2) {
  2487.           dprint(5, (debugfile, "dbz_fresh: preposterous size (%ld)\n", size));
  2488. !         return(NULL);
  2489.       }
  2490.   
  2491.       /* get default configuration */
  2492.       if (getconf((FILE *)NULL, (FILE *)NULL, &c) < 0)
  2493. !         return(NULL);    /* "can't happen" */
  2494.   
  2495.       /* and mess with it as specified */
  2496.       if (size != 0)
  2497. --- 310,321 ----
  2498.   
  2499.       if (size != 0 && size < 2) {
  2500.           dprint(5, (debugfile, "dbz_fresh: preposterous size (%ld)\n", size));
  2501. !         return (DBZ *)NULL;
  2502.       }
  2503.   
  2504.       /* get default configuration */
  2505.       if (getconf((FILE *)NULL, (FILE *)NULL, &c) < 0)
  2506. !         return (DBZ *)NULL; /* "can't happen" */
  2507.   
  2508.       /* and mess with it as specified */
  2509.       if (size != 0)
  2510. ***************
  2511. *** 316,346 ****
  2512.       /* write it out */
  2513.       fn = enstring(name, dir);
  2514.       if (fn == NULL)
  2515. !         return(NULL);
  2516.       f = fopen(fn, "w");
  2517. !     free(fn);
  2518.       if (f == NULL) {
  2519.           dprint(5, (debugfile, "dbz_fresh: unable to write config\n"));
  2520. !         return(NULL);
  2521.       }
  2522.       if (putconf(f, &c) < 0) {
  2523.           (void) fclose(f);
  2524. !         return(NULL);
  2525.       }
  2526.       if (fclose(f) == EOF) {
  2527.           dprint(5, (debugfile, "dbz_fresh: fclose failure\n"));
  2528. !         return(NULL);
  2529.       }
  2530.   
  2531.       /* create/truncate .pag */
  2532.       fn = enstring(name, pag);
  2533.       if (fn == NULL)
  2534. !         return(NULL);
  2535.       f = fopen(fn, "w");
  2536. !     free(fn);
  2537.       if (f == NULL) {
  2538.           dprint(5, (debugfile, "dbz_fresh: unable to create/truncate .pag file\n"));
  2539. !         return(NULL);
  2540.       } else
  2541.           (void) fclose(f);
  2542.   
  2543. --- 344,374 ----
  2544.       /* write it out */
  2545.       fn = enstring(name, dir);
  2546.       if (fn == NULL)
  2547. !         return (DBZ *)NULL;
  2548.       f = fopen(fn, "w");
  2549. !     free((malloc_t)fn);
  2550.       if (f == NULL) {
  2551.           dprint(5, (debugfile, "dbz_fresh: unable to write config\n"));
  2552. !         return (DBZ *)NULL;
  2553.       }
  2554.       if (putconf(f, &c) < 0) {
  2555.           (void) fclose(f);
  2556. !         return (DBZ *)NULL;
  2557.       }
  2558.       if (fclose(f) == EOF) {
  2559.           dprint(5, (debugfile, "dbz_fresh: fclose failure\n"));
  2560. !         return (DBZ *)NULL;
  2561.       }
  2562.   
  2563.       /* create/truncate .pag */
  2564.       fn = enstring(name, pag);
  2565.       if (fn == NULL)
  2566. !         return (DBZ *)NULL;
  2567.       f = fopen(fn, "w");
  2568. !     free((malloc_t)fn);
  2569.       if (f == NULL) {
  2570.           dprint(5, (debugfile, "dbz_fresh: unable to create/truncate .pag file\n"));
  2571. !         return (DBZ *)NULL;
  2572.       } else
  2573.           (void) fclose(f);
  2574.   
  2575. ***************
  2576. *** 426,443 ****
  2577.       /* pick up the old configuration */
  2578.       fn = enstring(oldname, dir);
  2579.       if (fn == NULL)
  2580. !         return(NULL);
  2581.       f = fopen(fn, "r");
  2582. !     free(fn);
  2583.       if (f == NULL) {
  2584.           dprint(5, (debugfile, "dbz_again: cannot open old .dir file\n"));
  2585. !         return(NULL);
  2586.       }
  2587.       i = getconf(f, (FILE *)NULL, &c);
  2588.       (void) fclose(f);
  2589.       if (i < 0) {
  2590.           dprint(5, (debugfile, "dbz_again: getconf failed\n"));
  2591. !         return(NULL);
  2592.       }
  2593.   
  2594.       /* tinker with it */
  2595. --- 454,471 ----
  2596.       /* pick up the old configuration */
  2597.       fn = enstring(oldname, dir);
  2598.       if (fn == NULL)
  2599. !         return (DBZ *)NULL;
  2600.       f = fopen(fn, "r");
  2601. !     free((malloc_t)fn);
  2602.       if (f == NULL) {
  2603.           dprint(5, (debugfile, "dbz_again: cannot open old .dir file\n"));
  2604. !         return (DBZ *)NULL;
  2605.       }
  2606.       i = getconf(f, (FILE *)NULL, &c);
  2607.       (void) fclose(f);
  2608.       if (i < 0) {
  2609.           dprint(5, (debugfile, "dbz_again: getconf failed\n"));
  2610. !         return (DBZ *)NULL;
  2611.       }
  2612.   
  2613.       /* tinker with it */
  2614. ***************
  2615. *** 463,491 ****
  2616.       /* write it out */
  2617.       fn = enstring(name, dir);
  2618.       if (fn == NULL)
  2619. !         return(NULL);
  2620.       f = fopen(fn, "w");
  2621. !     free(fn);
  2622.       if (f == NULL) {
  2623.           dprint(5, (debugfile, "dbz_again: unable to write new .dir\n"));
  2624. !         return(NULL);
  2625.       }
  2626.       i = putconf(f, &c);
  2627.       (void) fclose(f);
  2628.       if (i < 0) {
  2629.           dprint(5, (debugfile, "dbz_again: putconf failed\n"));
  2630. !         return(NULL);
  2631.       }
  2632.   
  2633.       /* create/truncate .pag */
  2634.       fn = enstring(name, pag);
  2635.       if (fn == NULL)
  2636. !         return(NULL);
  2637.       f = fopen(fn, "w");
  2638. !     free(fn);
  2639.       if (f == NULL) {
  2640.           dprint(5, (debugfile, "dbz_again: unable to create/truncate .pag file\n"));
  2641. !         return(NULL);
  2642.       } else
  2643.           (void) fclose(f);
  2644.   
  2645. --- 491,519 ----
  2646.       /* write it out */
  2647.       fn = enstring(name, dir);
  2648.       if (fn == NULL)
  2649. !         return (DBZ *)NULL;
  2650.       f = fopen(fn, "w");
  2651. !     free((malloc_t)fn);
  2652.       if (f == NULL) {
  2653.           dprint(5, (debugfile, "dbz_again: unable to write new .dir\n"));
  2654. !         return (DBZ *)NULL;
  2655.       }
  2656.       i = putconf(f, &c);
  2657.       (void) fclose(f);
  2658.       if (i < 0) {
  2659.           dprint(5, (debugfile, "dbz_again: putconf failed\n"));
  2660. !         return (DBZ *)NULL;
  2661.       }
  2662.   
  2663.       /* create/truncate .pag */
  2664.       fn = enstring(name, pag);
  2665.       if (fn == NULL)
  2666. !         return (DBZ *)NULL;
  2667.       f = fopen(fn, "w");
  2668. !     free((malloc_t)fn);
  2669.       if (f == NULL) {
  2670.           dprint(5, (debugfile, "dbz_again: unable to create/truncate .pag file\n"));
  2671. !         return (DBZ *)NULL;
  2672.       } else
  2673.           (void) fclose(f);
  2674.   
  2675. ***************
  2676. *** 512,540 ****
  2677.   
  2678.       if ((db = (DBZ *) calloc(sizeof(DBZ), 1)) == NULL) {
  2679.           dprint(5, (debugfile, "dbz_open: no room for DBZ structure\n"));
  2680. !         return(NULL);
  2681.       }
  2682.       /* open the .dir file */
  2683.       dirfname = enstring(name, dir);
  2684. !     if (dirfname == NULL)
  2685. !         return(NULL);
  2686.   
  2687.       if (mode == O_RDONLY) {
  2688.           db->dbz_dirf = fopen(dirfname, "r");
  2689.           db->dbz_dirronly = 1;
  2690.       } else
  2691.           db->dbz_dirf = fopen(dirfname, "r+");
  2692. !     free(dirfname);
  2693.       if (db->dbz_dirf == NULL) {
  2694.           dprint(5, (debugfile, "dbz_open: can't open .dir file\n"));
  2695. !         return(NULL);
  2696.       }
  2697.   
  2698.       /* open the .pag file */
  2699.       pagfname = enstring(name, pag);
  2700.       if (pagfname == NULL) {
  2701.           (void) fclose(db->dbz_dirf);
  2702. !         return(NULL);
  2703.       }
  2704.       if (mode == O_RDONLY) {
  2705.           db->dbz_pagf = fopen(pagfname, "rb");
  2706. --- 540,573 ----
  2707.   
  2708.       if ((db = (DBZ *) calloc(sizeof(DBZ), 1)) == NULL) {
  2709.           dprint(5, (debugfile, "dbz_open: no room for DBZ structure\n"));
  2710. !         return (DBZ *)NULL;
  2711.       }
  2712.       /* open the .dir file */
  2713.       dirfname = enstring(name, dir);
  2714. !     if (dirfname == NULL) {
  2715. !         free((malloc_t)db);
  2716. !         return (DBZ *)NULL;
  2717. !     }
  2718.   
  2719.       if (mode == O_RDONLY) {
  2720.           db->dbz_dirf = fopen(dirfname, "r");
  2721.           db->dbz_dirronly = 1;
  2722.       } else
  2723.           db->dbz_dirf = fopen(dirfname, "r+");
  2724. !     free((malloc_t)dirfname);
  2725.       if (db->dbz_dirf == NULL) {
  2726.           dprint(5, (debugfile, "dbz_open: can't open .dir file\n"));
  2727. !         free((malloc_t)db);
  2728. !         return (DBZ *)NULL;
  2729.       }
  2730.   
  2731.       /* open the .pag file */
  2732.       pagfname = enstring(name, pag);
  2733.       if (pagfname == NULL) {
  2734.           (void) fclose(db->dbz_dirf);
  2735. !         free((malloc_t)db);
  2736. !         return (DBZ *)NULL;
  2737.       }
  2738.       if (mode == O_RDONLY) {
  2739.           db->dbz_pagf = fopen(pagfname, "rb");
  2740. ***************
  2741. *** 545,552 ****
  2742.       if (db->dbz_pagf == NULL) {
  2743.           dprint(5, (debugfile, "dbz_open: .pag open failed\n"));
  2744.           (void) fclose(db->dbz_dirf);
  2745. !         free(pagfname);
  2746. !         return(NULL);
  2747.       }
  2748.   #ifdef NOBUFFER
  2749.       /*
  2750. --- 578,586 ----
  2751.       if (db->dbz_pagf == NULL) {
  2752.           dprint(5, (debugfile, "dbz_open: .pag open failed\n"));
  2753.           (void) fclose(db->dbz_dirf);
  2754. !         free((malloc_t)pagfname);
  2755. !         free((malloc_t)db);
  2756. !         return (DBZ *)NULL;
  2757.       }
  2758.   #ifdef NOBUFFER
  2759.       /*
  2760. ***************
  2761. *** 572,579 ****
  2762.           if (db->dbz_basefname == NULL) {
  2763.               (void) fclose(db->dbz_pagf);
  2764.               (void) fclose(db->dbz_dirf);
  2765. !             free(pagfname);
  2766. !             return(NULL);
  2767.           }
  2768.       } else
  2769.           db->dbz_basefname = NULL;
  2770. --- 606,614 ----
  2771.           if (db->dbz_basefname == NULL) {
  2772.               (void) fclose(db->dbz_pagf);
  2773.               (void) fclose(db->dbz_dirf);
  2774. !             free((malloc_t)pagfname);
  2775. !             free((malloc_t)db);
  2776. !             return (DBZ *)NULL;
  2777.           }
  2778.       } else
  2779.           db->dbz_basefname = NULL;
  2780. ***************
  2781. *** 589,597 ****
  2782.           (void) fclose(db->dbz_pagf);
  2783.           (void) fclose(db->dbz_basef);
  2784.           (void) fclose(db->dbz_dirf);
  2785. !         free(pagfname);
  2786.           errno = EDOM;    /* kind of a kludge, but very portable */
  2787. !         return(NULL);
  2788.       }
  2789.       db->dbz_tagbits = db->dbz_conf.tagmask << db->dbz_conf.tagshift;
  2790.       db->dbz_taghere = db->dbz_conf.tagenb << db->dbz_conf.tagshift;
  2791. --- 624,633 ----
  2792.           (void) fclose(db->dbz_pagf);
  2793.           (void) fclose(db->dbz_basef);
  2794.           (void) fclose(db->dbz_dirf);
  2795. !         free((malloc_t)pagfname);
  2796. !         free((malloc_t)db);
  2797.           errno = EDOM;    /* kind of a kludge, but very portable */
  2798. !         return (DBZ *)NULL;
  2799.       }
  2800.       db->dbz_tagbits = db->dbz_conf.tagmask << db->dbz_conf.tagshift;
  2801.       db->dbz_taghere = db->dbz_conf.tagenb << db->dbz_conf.tagshift;
  2802. ***************
  2803. *** 613,619 ****
  2804.           db->dbz_bufpagf = NULL;
  2805.           db->dbz_corepag = NULL;
  2806.       }
  2807. !     free(pagfname);
  2808.   
  2809.       /* misc. setup */
  2810.       crcinit();
  2811. --- 649,655 ----
  2812.           db->dbz_bufpagf = NULL;
  2813.           db->dbz_corepag = NULL;
  2814.       }
  2815. !     free((malloc_t)pagfname);
  2816.   
  2817.       /* misc. setup */
  2818.       crcinit();
  2819. ***************
  2820. *** 668,681 ****
  2821.           ret = -1;
  2822.       }
  2823.       if (db->dbz_corepag != NULL)
  2824. !         free((char *)db->dbz_corepag);
  2825.       db->dbz_corepag = NULL;
  2826.       if (fclose(db->dbz_basef) == EOF) {
  2827.           dprint(5, (debugfile, "dbz_close: fclose(basef) failed\n"));
  2828.           ret = -1;
  2829.       }
  2830.       if (db->dbz_basefname != NULL)
  2831. !         free(db->dbz_basefname);
  2832.       db->dbz_basef = NULL;
  2833.       db->dbz_pagf = NULL;
  2834.       if (fclose(db->dbz_dirf) == EOF) {
  2835. --- 704,717 ----
  2836.           ret = -1;
  2837.       }
  2838.       if (db->dbz_corepag != NULL)
  2839. !         free((malloc_t)db->dbz_corepag);
  2840.       db->dbz_corepag = NULL;
  2841.       if (fclose(db->dbz_basef) == EOF) {
  2842.           dprint(5, (debugfile, "dbz_close: fclose(basef) failed\n"));
  2843.           ret = -1;
  2844.       }
  2845.       if (db->dbz_basefname != NULL)
  2846. !         free((malloc_t)db->dbz_basefname);
  2847.       db->dbz_basef = NULL;
  2848.       db->dbz_pagf = NULL;
  2849.       if (fclose(db->dbz_dirf) == EOF) {
  2850. ***************
  2851. *** 683,689 ****
  2852.           ret = -1;
  2853.       }
  2854.   
  2855. !     free((char *) db);
  2856.   
  2857.       dprint(5, (debugfile, "dbz_close: %s\n", (ret == 0) ? "succeeded" : "failed"));
  2858.       return(ret);
  2859. --- 719,725 ----
  2860.           ret = -1;
  2861.       }
  2862.   
  2863. !     free((malloc_t) db);
  2864.   
  2865.       dprint(5, (debugfile, "dbz_close: %s\n", (ret == 0) ? "succeeded" : "failed"));
  2866.       return(ret);
  2867. ***************
  2868. *** 829,842 ****
  2869.   
  2870.       if (db->dbz_basefname == NULL) {
  2871.           dprint(5, (debugfile, "latebase: name foulup\n"));
  2872. !         return(NULL);
  2873.       }
  2874.       it = fopen(db->dbz_basefname, "r");
  2875.       if (it == NULL) {
  2876.           dprint(5, (debugfile, "latebase: still can't open base\n"));
  2877.       } else {
  2878.           dprint(5, (debugfile, "latebase: late open succeeded\n"));
  2879. !         free(db->dbz_basefname);
  2880.           db->dbz_basefname = NULL;
  2881.   #ifdef _IOFBF
  2882.           (void) setvbuf(it, db->dbz_basebuf, _IOFBF, sizeof(db->dbz_basebuf));
  2883. --- 865,878 ----
  2884.   
  2885.       if (db->dbz_basefname == NULL) {
  2886.           dprint(5, (debugfile, "latebase: name foulup\n"));
  2887. !         return (FILE *)NULL;
  2888.       }
  2889.       it = fopen(db->dbz_basefname, "r");
  2890.       if (it == NULL) {
  2891.           dprint(5, (debugfile, "latebase: still can't open base\n"));
  2892.       } else {
  2893.           dprint(5, (debugfile, "latebase: late open succeeded\n"));
  2894. !         free((malloc_t)db->dbz_basefname);
  2895.           db->dbz_basefname = NULL;
  2896.   #ifdef _IOFBF
  2897.           (void) setvbuf(it, db->dbz_basebuf, _IOFBF, sizeof(db->dbz_basebuf));
  2898. ***************
  2899. *** 988,996 ****
  2900.   }
  2901.   
  2902.   /*
  2903. !  - getno - get a long
  2904.    */
  2905. ! static long
  2906.   getno(f, ep)
  2907.   FILE *f;
  2908.   int *ep;
  2909. --- 1024,1032 ----
  2910.   }
  2911.   
  2912.   /*
  2913. !  - getno - get an int32
  2914.    */
  2915. ! static int32
  2916.   getno(f, ep)
  2917.   FILE *f;
  2918.   int *ep;
  2919. ***************
  2920. *** 1023,1029 ****
  2921.           dprint(5, (debugfile, "getno: `%s' non-numeric\n", getbuf));
  2922.           *ep = -1;
  2923.       }
  2924. !     return(atol(getbuf));
  2925.   }
  2926.   
  2927.   /*
  2928. --- 1059,1066 ----
  2929.           dprint(5, (debugfile, "getno: `%s' non-numeric\n", getbuf));
  2930.           *ep = -1;
  2931.       }
  2932. !     return((int32)atol(getbuf));
  2933.   }
  2934.   
  2935.   /*
  2936. ***************
  2937. *** 1073,1086 ****
  2938.       it = malloc((size_t)db->dbz_conf.tsize * SOF);
  2939.       if (it == NULL) {
  2940.           dprint(5, (debugfile, "getcore: malloc failed\n"));
  2941. !         return(NULL);
  2942.       }
  2943.   
  2944.       nread = fread(it, SOF, (size_t)db->dbz_conf.tsize, db->dbz_bufpagf);
  2945.       if (ferror(db->dbz_bufpagf)) {
  2946.           dprint(5, (debugfile, "getcore: read failed\n"));
  2947. !         free(it);
  2948. !         return(NULL);
  2949.       }
  2950.   
  2951.       p = (of_t *)it + nread;
  2952. --- 1110,1123 ----
  2953.       it = malloc((size_t)db->dbz_conf.tsize * SOF);
  2954.       if (it == NULL) {
  2955.           dprint(5, (debugfile, "getcore: malloc failed\n"));
  2956. !         return (of_t *)NULL;
  2957.       }
  2958.   
  2959.       nread = fread(it, SOF, (size_t)db->dbz_conf.tsize, db->dbz_bufpagf);
  2960.       if (ferror(db->dbz_bufpagf)) {
  2961.           dprint(5, (debugfile, "getcore: read failed\n"));
  2962. !         free((malloc_t)it);
  2963. !         return (of_t *)NULL;
  2964.       }
  2965.   
  2966.       p = (of_t *)it + nread;
  2967.  
  2968. Index: lib/opt_utils.c
  2969. Prereq: 5.7
  2970. *** ../elm2.4/lib/opt_utils.c    Tue Jan 19 22:02:34 1993
  2971. --- lib/opt_utils.c    Tue Aug  3 16:11:44 1993
  2972. ***************
  2973. *** 1,8 ****
  2974.   
  2975. ! static char rcsid[] = "@(#)$Id: opt_utils.c,v 5.7 1993/01/20 03:02:19 syd Exp $";
  2976.   
  2977.   /*******************************************************************************
  2978. !  *  The Elm Mail System  -  $Revision: 5.7 $   $State: Exp $
  2979.    *
  2980.    *            Copyright (c) 1988-1992 USENET Community Trust
  2981.    *            Copyright (c) 1986,1987 Dave Taylor
  2982. --- 1,8 ----
  2983.   
  2984. ! static char rcsid[] = "@(#)$Id: opt_utils.c,v 5.8 1993/08/03 19:28:39 syd Exp $";
  2985.   
  2986.   /*******************************************************************************
  2987. !  *  The Elm Mail System  -  $Revision: 5.8 $   $State: Exp $
  2988.    *
  2989.    *            Copyright (c) 1988-1992 USENET Community Trust
  2990.    *            Copyright (c) 1986,1987 Dave Taylor
  2991. ***************
  2992. *** 14,19 ****
  2993. --- 14,31 ----
  2994.    *
  2995.    *******************************************************************************
  2996.    * $Log: opt_utils.c,v $
  2997. +  * Revision 5.8  1993/08/03  19:28:39  syd
  2998. +  * Elm tries to replace the system toupper() and tolower() on current
  2999. +  * BSD systems, which is unnecessary.  Even worse, the replacements
  3000. +  * collide during linking with routines in isctype.o.  This patch adds
  3001. +  * a Configure test to determine whether replacements are really needed
  3002. +  * (BROKE_CTYPE definition).  The <ctype.h> header file is now included
  3003. +  * globally through hdrs/defs.h and the BROKE_CTYPE patchup is handled
  3004. +  * there.  Inclusion of <ctype.h> was removed from *all* the individual
  3005. +  * files, and the toupper() and tolower() routines in lib/opt_utils.c
  3006. +  * were dropped.
  3007. +  * From: chip@chinacat.unicom.com (Chip Rosenthal)
  3008. +  *
  3009.    * Revision 5.7  1993/01/20  03:02:19  syd
  3010.    * Move string declarations to defs.h
  3011.    * From: Syd
  3012. ***************
  3013. *** 57,63 ****
  3014.   
  3015.   #include "headers.h"
  3016.   #include "s_error.h"
  3017. - #include <ctype.h>
  3018.   
  3019.   #ifdef PWDINSYS
  3020.   #  include <sys/pwd.h>
  3021. --- 69,74 ----
  3022. ***************
  3023. *** 65,75 ****
  3024.   #  include <pwd.h>
  3025.   #endif
  3026.   
  3027. - #ifdef BSD
  3028. - #undef tolower
  3029. - #undef toupper
  3030. - #endif
  3031.   #ifndef GETHOSTNAME
  3032.   # ifdef DOUNAME
  3033.   #  include <sys/utsname.h>
  3034. --- 76,81 ----
  3035. ***************
  3036. *** 217,251 ****
  3037.   
  3038.   #endif
  3039.   
  3040. - #if defined(BSD) && !defined(_POSIX_SOURCE)
  3041. - /** some supplementary string functions for Berkeley Unix systems **/
  3042. - int
  3043. - tolower(ch)
  3044. - int ch;
  3045. - {
  3046. -     /** This should be a macro call, but if you use this as a macro
  3047. -         calls to 'tolower' where the argument is a function call will
  3048. -         cause the function to be called TWICE which is obviously the
  3049. -         wrong behaviour.  On the other hand, to just blindly translate
  3050. -         assuming the character is always uppercase can cause BIG
  3051. -         problems, so...
  3052. -     **/
  3053. -     return ( isupper(ch) ? ch - 'A' + 'a' : ch );
  3054. - }
  3055. - int
  3056. - toupper(ch)
  3057. - int ch;
  3058. - {
  3059. -     /** see comment for above routine - tolower() **/
  3060. -     return ( islower(ch) ? ch - 'a' + 'A' : ch );
  3061. - }
  3062. - #endif
  3063.   
  3064.   #ifndef STRTOK
  3065.   
  3066. --- 223,228 ----
  3067.  
  3068. Index: lib/parsarpdat.c
  3069. Prereq: 5.2
  3070. *** ../elm2.4/lib/parsarpdat.c    Sun Apr 11 22:16:33 1993
  3071. --- lib/parsarpdat.c    Tue Aug  3 15:28:55 1993
  3072. ***************
  3073. *** 1,8 ****
  3074.   
  3075. ! static char rcsid[] = "@(#)$Id: parsarpdat.c,v 5.2 1993/04/12 02:16:32 syd Exp $";
  3076.   
  3077.   /*******************************************************************************
  3078. !  *  The Elm Mail System  -  $Revision: 5.2 $   $State: Exp $
  3079.    *
  3080.    *             Copyright (c) 1993 USENET Community Trust
  3081.    *******************************************************************************
  3082. --- 1,8 ----
  3083.   
  3084. ! static char rcsid[] = "@(#)$Id: parsarpdat.c,v 5.3 1993/08/03 19:28:39 syd Exp $";
  3085.   
  3086.   /*******************************************************************************
  3087. !  *  The Elm Mail System  -  $Revision: 5.3 $   $State: Exp $
  3088.    *
  3089.    *             Copyright (c) 1993 USENET Community Trust
  3090.    *******************************************************************************
  3091. ***************
  3092. *** 13,18 ****
  3093. --- 13,30 ----
  3094.    *
  3095.    *******************************************************************************
  3096.    * $Log: parsarpdat.c,v $
  3097. +  * Revision 5.3  1993/08/03  19:28:39  syd
  3098. +  * Elm tries to replace the system toupper() and tolower() on current
  3099. +  * BSD systems, which is unnecessary.  Even worse, the replacements
  3100. +  * collide during linking with routines in isctype.o.  This patch adds
  3101. +  * a Configure test to determine whether replacements are really needed
  3102. +  * (BROKE_CTYPE definition).  The <ctype.h> header file is now included
  3103. +  * globally through hdrs/defs.h and the BROKE_CTYPE patchup is handled
  3104. +  * there.  Inclusion of <ctype.h> was removed from *all* the individual
  3105. +  * files, and the toupper() and tolower() routines in lib/opt_utils.c
  3106. +  * were dropped.
  3107. +  * From: chip@chinacat.unicom.com (Chip Rosenthal)
  3108. +  *
  3109.    * Revision 5.2  1993/04/12  02:16:32  syd
  3110.    * Fix year handling bug in date(1) time formats.
  3111.    * From: chip@chinacat.unicom.com (Chip Rosenthal)
  3112. ***************
  3113. *** 25,31 ****
  3114.   
  3115.   
  3116.   #include "headers.h"
  3117. - #include <ctype.h>
  3118.   
  3119.   
  3120.   /*
  3121. --- 37,42 ----
  3122.  
  3123.